feat: 修复未登录情况下死循环的bug

This commit is contained in:
pixelmaxQM
2025-03-15 16:42:36 +08:00
parent a79df727c9
commit e9dd55f4f9

View File

@@ -86,14 +86,13 @@ 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 && await setupRouter(userStore)
!WHITE_LIST.includes(from.name) }
) { return { name: userStore.userInfo.authority.defaultRouter }
await setupRouter(userStore)
} }
return { name: userStore.userInfo.authority.defaultRouter } return true
} }
// 需要登录的路由处理 // 需要登录的路由处理