Skip to content

Commit e9dd55f

Browse files
committed
feat: 修复未登录情况下死循环的bug
1 parent a79df72 commit e9dd55f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

web/src/permission.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,13 @@ router.beforeEach(async (to, from) => {
8686

8787
// 白名单路由处理
8888
if (WHITE_LIST.includes(to.name)) {
89-
if (
90-
token &&
91-
!routerStore.asyncRouterFlag &&
92-
!WHITE_LIST.includes(from.name)
93-
) {
94-
await setupRouter(userStore)
89+
if (token) {
90+
if(!routerStore.asyncRouterFlag){
91+
await setupRouter(userStore)
92+
}
93+
return { name: userStore.userInfo.authority.defaultRouter }
9594
}
96-
return { name: userStore.userInfo.authority.defaultRouter }
95+
return true
9796
}
9897

9998
// 需要登录的路由处理

0 commit comments

Comments
 (0)