feat: 未登录情况下防止进入路由死循环

This commit is contained in:
pixelmaxQM 2025-03-16 11:53:44 +08:00
parent e9dd55f4f9
commit e8eacb02d6
1 changed files with 3 additions and 1 deletions

View File

@ -90,7 +90,9 @@ router.beforeEach(async (to, from) => {
if(!routerStore.asyncRouterFlag){ if(!routerStore.asyncRouterFlag){
await setupRouter(userStore) await setupRouter(userStore)
} }
return { name: userStore.userInfo.authority.defaultRouter } if(userStore.userInfo.authority.defaultRouter){
return { name: userStore.userInfo.authority.defaultRouter }
}
} }
return true return true
} }