From 7fa87ba08bd6a5d29dfc7df009a25d49be363746 Mon Sep 17 00:00:00 2001 From: Seven Date: Mon, 22 Dec 2025 21:08:05 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=AE=88=E5=8D=AB=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E4=BB=8E=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E9=87=8D=E5=AE=9A?= =?UTF-8?q?=E5=90=91=E5=88=B0=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/guard.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/router/guard.ts b/src/router/guard.ts index 38fc01d..37957a6 100644 --- a/src/router/guard.ts +++ b/src/router/guard.ts @@ -4,6 +4,9 @@ export function createRouterGuard(router: Router) { router.beforeEach(async (to, from, next) => { const userStore = useUserStore(); if (to.meta.requiresAuth && !userStore.isAuthenticated) { + if (from.path === "/auth/login") { + return next("/"); + } const redirect = encodeURIComponent(to.fullPath); return next({ path: "/auth/login", query: { redirect } }); }