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