mirror of
https://gitcode.com/flipped-aurora/gin-vue-admin.git
synced 2025-12-30 03:42:26 +00:00
feat: 未登录情况下防止进入路由死循环
This commit is contained in:
@@ -90,7 +90,9 @@ router.beforeEach(async (to, from) => {
|
||||
if(!routerStore.asyncRouterFlag){
|
||||
await setupRouter(userStore)
|
||||
}
|
||||
return { name: userStore.userInfo.authority.defaultRouter }
|
||||
if(userStore.userInfo.authority.defaultRouter){
|
||||
return { name: userStore.userInfo.authority.defaultRouter }
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user