Files
AI_OJ_FRONTEND/src/router/index.ts
meowrain d01117c6ea feat(router): 添加根路径重定向到首页的路由配置
添加根路径("/")的重定向配置,使其自动跳转到首页("/home"),并设置该路由不在菜单中显示
2026-01-10 19:37:39 +08:00

49 lines
1.3 KiB
TypeScript

import type { RouteRecordRaw } from "vue-router";
import HomeView from "../views/HomeView.vue";
import AboutView from "../views/AboutView.vue";
import ACCESS_ENUM from "../access/accessEnum";
import UserLoginView from "../views/user/UserLoginView.vue";
import UserRegisterView from "../views/user/UserRegisterView.vue";
import AiChatView from "../views/ai/AiChatView.vue";
/**
* 路由配置
*/
export const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "root",
redirect: "/home",
meta: { hideInMenu: true },
},
{
path: "/home",
name: "HomeView",
component: HomeView,
meta: { hideInMenu: false, access: ACCESS_ENUM.NOT_LOGIN },
},
{
path: "/about",
name: "AboutView",
component: AboutView,
meta: { hideInMenu: false, access: ACCESS_ENUM.NOT_LOGIN },
},
{
path: "/ai/chat",
name: "AiChatView",
component: AiChatView,
meta: { hideInMenu: false, access: ACCESS_ENUM.USER },
},
{
path: "/user/login",
name: "UserLoginView",
component: UserLoginView,
meta: { hideInMenu: true, access: ACCESS_ENUM.NOT_LOGIN },
},
{
path: "/user/register",
name: "UserRegisterView",
component: UserRegisterView,
meta: { hideInMenu: true, access: ACCESS_ENUM.NOT_LOGIN },
},
];