feat: 注释console
This commit is contained in:
@ -32,39 +32,39 @@ router.beforeEach(async (to, from, next) => {
|
||||
// 添加完动态路由之后,需要在进行一次主动跳转
|
||||
const afterMenuList = getItem('menusPermission');
|
||||
// 处理用户权限,筛选出需要添加的权限
|
||||
console.log(store.state.permission.routes);
|
||||
// console.log(store.state.permission.routes);
|
||||
|
||||
if (store.state.permission.routes.length === 0) {
|
||||
const filterRoutes = await store.dispatch('permission/filterRoutes', afterMenuList)
|
||||
filterRoutes.forEach(item => {
|
||||
router.addRoute(item)
|
||||
})
|
||||
console.log("已添加动态路由");
|
||||
// console.log("已添加动态路由");
|
||||
next({
|
||||
...to,
|
||||
replace: true
|
||||
})
|
||||
} else {
|
||||
console.log('已存在路由');
|
||||
// console.log('已存在路由');
|
||||
next()
|
||||
}
|
||||
// 利用 addRoute 循环添加
|
||||
} else {
|
||||
// 没有token的情况下,可以进入白名单
|
||||
if (whiteList.indexOf(to.path) > -1) {
|
||||
console.log("路由2");
|
||||
// console.log("路由2");
|
||||
next()
|
||||
} else {
|
||||
const cookie = getCookie("clientKey");
|
||||
if (cookie) {
|
||||
console.log("路由3");
|
||||
// console.log("路由3");
|
||||
next(`/zeroTrust_login`)
|
||||
} else {
|
||||
console.log("路由4");
|
||||
// console.log("路由4");
|
||||
const isOatuh = getItem('isOatuh')
|
||||
// 没有token的情况下,可以进入白名单
|
||||
if (isOatuh) {
|
||||
console.log("路由5");
|
||||
// console.log("路由5");
|
||||
const idEntityCard = getItem('idEntityCard')
|
||||
next(`/oatuh_login?token=${Base64.encode(idEntityCard)}`)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user