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() }