| | |
| | | NProgress.configure({ showSpinner: false }) |
| | | const lockPage = '/lock' //锁屏页 |
| | | const urlParams = getUrlParams(window.location.href) |
| | | const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL |
| | | const env = import.meta.env.VITE_APP_ENV |
| | | |
| | | function findRouteByPath (routes, targetPath) { |
| | |
| | | // query: firstMenu.query || {}, |
| | | // meta: firstMenu.meta || {}, |
| | | // }) |
| | | store.commit('ADD_TAG', { |
| | | name: toMenu.name, |
| | | path: toMenu.path, |
| | | fullPath: toMenu.path, |
| | | params: toMenu.params || {}, |
| | | query: toMenu.query || {}, |
| | | meta: toMenu.meta || {}, |
| | | }) |
| | | if (toMenu && to.meta?.isTab !== false) { |
| | | store.commit('ADD_TAG', { |
| | | name: toMenu.name, |
| | | path: toMenu.path, |
| | | fullPath: toMenu.path, |
| | | params: toMenu.params || {}, |
| | | query: toMenu.query || {}, |
| | | meta: toMenu.meta || {}, |
| | | }) |
| | | } |
| | | |
| | | next(to.fullPath) |
| | | } |
| | |
| | | if (meta.isAuth === false) { |
| | | next() |
| | | } else { |
| | | next('/login') |
| | | logOutFun() |
| | | // env === 'development' ? next('/login') : window.location.replace(`${adminUrl}#/login`) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |