From 7cfcf056f9db9299b2ae2354845fec85b4ae4f1a Mon Sep 17 00:00:00 2001 From: IGCrystal Date: Mon, 16 Jun 2025 21:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf:=20=E4=BD=BF=E7=94=A8=20has?= =?UTF-8?q?h=20=E8=B7=AF=E7=94=B1=E6=A8=A1=E5=BC=8F=E4=BB=A5=E9=81=BF?= =?UTF-8?q?=E5=85=8D404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/src/router/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/src/router/index.ts b/dashboard/src/router/index.ts index 738fdda1d..18b5737e4 100644 --- a/dashboard/src/router/index.ts +++ b/dashboard/src/router/index.ts @@ -1,11 +1,11 @@ -import { createRouter, createWebHistory } from 'vue-router'; +import { createRouter, createWebHashHistory } from 'vue-router'; import MainRoutes from './MainRoutes'; import AuthRoutes from './AuthRoutes'; import ChatBoxRoutes from './ChatBoxRoutes'; import { useAuthStore } from '@/stores/auth'; export const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), + history: createWebHashHistory(import.meta.env.BASE_URL), routes: [ MainRoutes, AuthRoutes, @@ -26,7 +26,7 @@ router.beforeEach(async (to, from, next) => { const authRequired = !publicPages.includes(to.path); const auth: AuthStore = useAuthStore(); - // 如果用户已登录且试图访问登录页面,则重定向到首页或之前尝试访问的页面 + // 如果用户已登录且试图访问登录页面,则重定向到首页 if (to.path === '/auth/login' && auth.has_token()) { return next(auth.returnUrl || '/'); }