|
|
|
@ -12,6 +12,7 @@ NProgress.configure({ showSpinner: false }) |
|
|
|
|
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee','/userSelect'] |
|
|
|
|
|
|
|
|
|
router.beforeEach((to, from, next) => { |
|
|
|
|
debugger |
|
|
|
|
NProgress.start() |
|
|
|
|
if (getAccessToken()) { |
|
|
|
|
to.meta.title && store.dispatch('settings/setTitle', to.meta.title) |
|
|
|
@ -19,7 +20,17 @@ router.beforeEach((to, from, next) => { |
|
|
|
|
if (to.path === '/login') { |
|
|
|
|
next({ path: '/report/eventList/index' }) |
|
|
|
|
NProgress.done() |
|
|
|
|
} else { |
|
|
|
|
} else if (to.path === '/userSelect'&&from.path!=='/userSelect') { |
|
|
|
|
store.dispatch('LogOut').then(() => { |
|
|
|
|
next({ path: '/userSelect' }) |
|
|
|
|
NProgress.done() |
|
|
|
|
}) |
|
|
|
|
}else if (to.path==='/404') { |
|
|
|
|
store.dispatch('LogOut').then(() => { |
|
|
|
|
next({ path: '/userSelect' }) |
|
|
|
|
NProgress.done() |
|
|
|
|
}) |
|
|
|
|
}else { |
|
|
|
|
if (store.getters.roles.length === 0) { |
|
|
|
|
isRelogin.show = true |
|
|
|
|
// 获取字典数据 add by 芋艿
|
|
|
|
|