fix: 路由bug修改
This commit is contained in:
@@ -49,8 +49,8 @@ function setupCommonGuard(router: Router) {
|
||||
return { path: '/auth/login', query: { redirect: to.fullPath }, replace: true }
|
||||
}
|
||||
|
||||
// 没有访问权限,跳转登录页面
|
||||
if (to.fullPath !== '/auth/login') {
|
||||
// 没有访问权限,跳转登录页面(使用 to.path 而非 to.fullPath,避免 query 参数导致无限重定向)
|
||||
if (to.path !== '/auth/login') {
|
||||
return {
|
||||
path: '/auth/login',
|
||||
query: { redirect: to.fullPath },
|
||||
@@ -58,7 +58,8 @@ function setupCommonGuard(router: Router) {
|
||||
replace: true
|
||||
}
|
||||
}
|
||||
return to
|
||||
// 登录页面且已带 redirect 参数(由上面逻辑设置),允许进入
|
||||
return true
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user