From 1a87cf4ea7a5407f99e67d0f0a29c2f15c4eba78 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Fri, 22 Aug 2025 16:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=97=A0=E9=99=90?= =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/routeGuard.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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' ]