| | |
| | | |
| | | // 登录验证 |
| | | // 排除登录页的校验 |
| | | if (to.path === "/login") { |
| | | if (sessionStorage.getItem('token')) { |
| | | next('/projectList'); // 已登录状态访问登录页时重定向到系统首页 |
| | | return; |
| | | } |
| | | next(); |
| | | return; |
| | | } |
| | | // if (to.path === "/login") { |
| | | // if (sessionStorage.getItem('token')) { |
| | | // next('/projectList'); // 已登录状态访问登录页时重定向到系统首页 |
| | | // return; |
| | | // } |
| | | // next(); |
| | | // return; |
| | | // } |
| | | |
| | | // 登录状态校验 |
| | | const isAuthenticated = sessionStorage.getItem('token'); |
| | | // // 登录状态校验 |
| | | // const isAuthenticated = sessionStorage.getItem('token'); |
| | | // if (!isAuthenticated) { |
| | | // next('/login'); // 未登录用户重定向到登录页 |
| | | // return; |