|
|
@ -10,7 +10,7 @@ import { ACCESS_TOKEN, ALL_APPS_MENU } from '@/store/mutation-types'
|
|
|
|
import { Modal, notification } from 'ant-design-vue' // NProgress Configuration
|
|
|
|
import { Modal, notification } from 'ant-design-vue' // NProgress Configuration
|
|
|
|
import { timeFix } from '@/utils/util' /// es/notification
|
|
|
|
import { timeFix } from '@/utils/util' /// es/notification
|
|
|
|
NProgress.configure({ showSpinner: false })
|
|
|
|
NProgress.configure({ showSpinner: false })
|
|
|
|
const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist
|
|
|
|
const whiteList = ['login', 'register', 'registerResult', 'getway'] // no redirect whitelist
|
|
|
|
// 无默认首页的情况
|
|
|
|
// 无默认首页的情况
|
|
|
|
const defaultRoutePath = '/welcome'
|
|
|
|
const defaultRoutePath = '/welcome'
|
|
|
|
|
|
|
|
|
|
|
@ -20,7 +20,7 @@ router.beforeEach((to, from, next) => {
|
|
|
|
if (Vue.ls.get(ACCESS_TOKEN)) {
|
|
|
|
if (Vue.ls.get(ACCESS_TOKEN)) {
|
|
|
|
/* has token */
|
|
|
|
/* has token */
|
|
|
|
if (to.path === '/user/login') {
|
|
|
|
if (to.path === '/user/login') {
|
|
|
|
//next({ path: defaultRoutePath })
|
|
|
|
// next({ path: defaultRoutePath })
|
|
|
|
NProgress.done()
|
|
|
|
NProgress.done()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// console.log('=== 非跳转登录页面 ===', store.getters.roles.length)
|
|
|
|
// console.log('=== 非跳转登录页面 ===', store.getters.roles.length)
|
|
|
@ -112,6 +112,7 @@ router.beforeEach((to, from, next) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
console.log(to.name)
|
|
|
|
if (whiteList.includes(to.name)) {
|
|
|
|
if (whiteList.includes(to.name)) {
|
|
|
|
// 在免登录白名单,直接进入
|
|
|
|
// 在免登录白名单,直接进入
|
|
|
|
next()
|
|
|
|
next()
|
|
|
|