|
|
|
@ -56,6 +56,13 @@ router.beforeEach((to, from, next) => { |
|
|
|
const token = getToken(); |
|
|
|
const isPop = to.query.pop === 'true'; //新窗口打开内页
|
|
|
|
NProgress.start(); |
|
|
|
|
|
|
|
const overLay: IObject | null = document.querySelector('.el-overlay .modify-form'); |
|
|
|
|
|
|
|
if (overLay && overLay.parentNode) { |
|
|
|
overLay.parentNode.remove(); |
|
|
|
} |
|
|
|
|
|
|
|
if (to.path !== '/login') { |
|
|
|
if (store.state.routes.length) { |
|
|
|
if (to.name === 'error') { |
|
|
|
@ -176,7 +183,7 @@ router.beforeEach((to, from, next) => { |
|
|
|
if (to.meta.requiresAuth) { |
|
|
|
next('/login'); |
|
|
|
} else { |
|
|
|
next(); |
|
|
|
next(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
@ -186,12 +193,11 @@ router.beforeEach((to, from, next) => { |
|
|
|
} |
|
|
|
} else { |
|
|
|
store.commit('updateState', { appIsReady: true, appIsRender: true }); |
|
|
|
if (import.meta.env.VITE_APP_API_HOME) { |
|
|
|
if (import.meta.env.VITE_APP_API_HOME) { |
|
|
|
window.location.href = import.meta.env.VITE_APP_API_HOME; |
|
|
|
} else { |
|
|
|
next(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|