lcw
This commit is contained in:
@ -1,15 +1,16 @@
|
||||
import router from './router'
|
||||
import Base64 from "base-64";
|
||||
import store from './store'
|
||||
import {
|
||||
unifiedLogin
|
||||
} from "@/api/user-manage";
|
||||
import {
|
||||
setItem,
|
||||
getItem,
|
||||
removeAllItem
|
||||
} from "@/utils/storage";
|
||||
import {
|
||||
getCookie
|
||||
} from "@/utils/cookie";
|
||||
// 白名单
|
||||
const whiteList = ['/login', '/oatuh_login', '/404', '/401', '/focusExploration', '/clueVerification', '/deploymentApproval']
|
||||
const whiteList = ['/login', '/oatuh_login', '/404', '/401', '/zeroTrust_login', '/focusExploration', '/clueVerification', '/deploymentApproval']
|
||||
/**
|
||||
* 路由前置守卫
|
||||
* to 去哪里
|
||||
@ -43,16 +44,22 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
// 利用 addRoute 循环添加
|
||||
} else {
|
||||
const isOatuh = getItem('isOatuh')
|
||||
// 没有token的情况下,可以进入白名单
|
||||
if (whiteList.indexOf(to.path) > -1) {
|
||||
next()
|
||||
} else {
|
||||
if (isOatuh) {
|
||||
const idEntityCard = getItem('idEntityCard')
|
||||
next(`/oatuh_login?token=${Base64.encode(idEntityCard)}`)
|
||||
const cookie = getCookie("clientKey");
|
||||
if (cookie) {
|
||||
next(`/zeroTrust_login`)
|
||||
} else {
|
||||
next('/login')
|
||||
const isOatuh = getItem('isOatuh')
|
||||
// 没有token的情况下,可以进入白名单
|
||||
if (isOatuh) {
|
||||
const idEntityCard = getItem('idEntityCard')
|
||||
next(`/oatuh_login?token=${Base64.encode(idEntityCard)}`)
|
||||
} else {
|
||||
next('/login')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user