fix: 路由bug修改

This commit is contained in:
2026-06-23 12:06:58 +08:00
parent 47fb151ea8
commit 88ab464d6a

View File

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