mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:07:58 +08:00
在路由守卫中捕获异常时,添加登出逻辑
This commit is contained in:
@@ -47,7 +47,7 @@ function setupRoutes(router: Router) {
|
||||
}
|
||||
else {
|
||||
try {
|
||||
// 获取用户权限
|
||||
// 获取用户权限
|
||||
settingsStore.settings.app.enablePermission && await userStore.getPermissions()
|
||||
// 生成动态路由
|
||||
switch (settingsStore.settings.app.routeBaseOn) {
|
||||
@@ -85,7 +85,9 @@ function setupRoutes(router: Router) {
|
||||
}
|
||||
routeStore.setCurrentRemoveRoutes(removeRoutes)
|
||||
}
|
||||
catch {}
|
||||
catch {
|
||||
userStore.logout()
|
||||
}
|
||||
// 动态路由生成并注册后,重新进入当前路由
|
||||
next({
|
||||
path: to.path,
|
||||
|
||||
Reference in New Issue
Block a user