feat: 修复未登录情况下死循环的bug
This commit is contained in:
@@ -86,15 +86,14 @@ router.beforeEach(async (to, from) => {
|
|||||||
|
|
||||||
// 白名单路由处理
|
// 白名单路由处理
|
||||||
if (WHITE_LIST.includes(to.name)) {
|
if (WHITE_LIST.includes(to.name)) {
|
||||||
if (
|
if (token) {
|
||||||
token &&
|
if(!routerStore.asyncRouterFlag){
|
||||||
!routerStore.asyncRouterFlag &&
|
|
||||||
!WHITE_LIST.includes(from.name)
|
|
||||||
) {
|
|
||||||
await setupRouter(userStore)
|
await setupRouter(userStore)
|
||||||
}
|
}
|
||||||
return { name: userStore.userInfo.authority.defaultRouter }
|
return { name: userStore.userInfo.authority.defaultRouter }
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// 需要登录的路由处理
|
// 需要登录的路由处理
|
||||||
if (token) {
|
if (token) {
|
||||||
|
Reference in New Issue
Block a user