| | |
| | | NProgress.configure({ showSpinner: false }) |
| | | const lockPage = '/lock' //锁屏页 |
| | | const urlParams = getUrlParams(window.location.href) |
| | | |
| | | const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL |
| | | function findRouteByPath (routes, targetPath) { |
| | | // 遍历数组中的每个路由对象 |
| | | for (const route of routes) { |
| | |
| | | } else { |
| | | const systemToken = store.getters.token || urlParams?.token |
| | | if (systemToken === 0) { |
| | | store.dispatch('FedLogOut').then(() => { |
| | | next({ path: '/login' }) |
| | | }) |
| | | // store.dispatch('FedLogOut').then(() => { |
| | | // next({ path: '/login' }) |
| | | // }) |
| | | store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`)); |
| | | } else { |
| | | const meta = to.meta || {} |
| | | const query = to.query || {} |
| | |
| | | if (meta.isAuth === false) { |
| | | next() |
| | | } else { |
| | | next('/login') |
| | | // next('/login') |
| | | window.location.replace(`${adminUrl}#/login`) |
| | | } |
| | | } |
| | | }) |