From b94c34bf600b17250f04ddac3c396c831ffe45e2 Mon Sep 17 00:00:00 2001 From: En Date: Thu, 9 Apr 2026 21:32:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=AC=E4=BC=97=E7=AB=AF?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81=E6=97=A0=E6=B3=95=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/router/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 1a372be..3f18f16 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -492,6 +492,16 @@ router.beforeEach(async (to, _from, next) => { return } + // 根路径:检查公众端登录状态,已登录则跳转活动大厅,未登录则跳转公众端登录页 + if (to.path === "/") { + if (localStorage.getItem("public_token")) { + next({ path: "/p/activities", replace: true }) + } else { + next({ path: "/p/login", replace: true }) + } + return + } + const authStore = useAuthStore() const tenantCodeFromUrl = extractTenantCodeFromPath(to.path)