diff --git a/src/utils/routeGuard.js b/src/utils/routeGuard.js index 0c0a82a..153853a 100644 --- a/src/utils/routeGuard.js +++ b/src/utils/routeGuard.js @@ -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' ]