49 lines
1.3 KiB
TypeScript
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 },
|
|
},
|
|
];
|