修复了无限循环问题

This commit is contained in:
tianfeng 2025-08-22 16:02:05 +08:00
parent e0605a617d
commit 1a87cf4ea7

View File

@ -201,7 +201,12 @@ class RouteGuard {
if (!userId) {
console.debug('❌ No user ID, redirecting to apply')
console.groupEnd()
next(PAGES.APPLY)
// 防止无限循环:如果已经在申请页面,就不再重定向
if (to.path === PAGES.APPLY) {
next()
} else {
next(PAGES.APPLY)
}
return
}
@ -238,7 +243,8 @@ class RouteGuard {
*/
isPublicPage(path) {
const publicPages = [
PAGES.NOT_APP,
PAGES.APPLY, // 申请页面 - 任何人都可以访问
PAGES.NOT_APP, // 错误页面
'/404',
'/error'
]