From 6ca00c1478fcb43e10ed76838a1d33ebad74b980 Mon Sep 17 00:00:00 2001 From: SunCheng Date: Wed, 18 Feb 2026 22:20:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=86=E9=BB=98=E8=AE=A4=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=94=B9=E4=B8=BA=E6=97=A5=E5=8E=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加根路径 / 重定向到日历页面 calendar-v2 - 修改已登录用户访问登录页时的跳转目标为日历页面 - 现在访问 http://localhost:5173/ 会直接进入日历页面 --- Web/src/router/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Web/src/router/index.js b/Web/src/router/index.js index f847861..49a9fa9 100644 --- a/Web/src/router/index.js +++ b/Web/src/router/index.js @@ -4,6 +4,12 @@ import { useAuthStore } from '@/stores/auth' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ + { + path: '/', + name: 'home', + redirect: { name: 'calendar-v2' }, + meta: { requiresAuth: true } + }, { path: '/login', name: 'login', @@ -119,8 +125,8 @@ router.beforeEach((to, from, next) => { // 需要认证但未登录,跳转到登录页 next({ name: 'login', query: { redirect: to.fullPath } }) } else if (to.name === 'login' && authStore.isAuthenticated) { - // 已登录用户访问登录页,跳转到首页 - next({ name: 'statistics-v2' }) + // 已登录用户访问登录页,跳转到日历页面 + next({ name: 'calendar-v2' }) } else { next() }