| | |
| | | |
| | | NProgress.configure({ showSpinner: false }) |
| | | |
| | | const whiteList = ['/login', '/register'] |
| | | const whiteList = ['/login', '/register','/thirdpartylogin', '/logindemo'] |
| | | |
| | | const isWhiteList = (path) => { |
| | | return whiteList.some(pattern => isPathMatch(pattern, path)) |
| | |
| | | } else if (isWhiteList(to.path)) { |
| | | next() |
| | | } else { |
| | | if (store.getters.roles.length === 0) { |
| | | if (store.getters.roles.length === 0) { |
| | | isRelogin.show = true |
| | | // 判断当前用户是否已拉取完user_info信息 |
| | | store.dispatch('GetInfo').then(() => { |
| | |
| | | next({ path: '/' }) |
| | | }) |
| | | }) |
| | | } else { |
| | | next() |
| | | } else { |
| | | if (store.getters.isLock && to.path !=='/lock') { |
| | | next('/lock') |
| | | } else { |
| | | next() |
| | | } |
| | | } |
| | | } |
| | | } else { |