Files
AI_OJ_FRONTEND/src/router/index.ts
meowrain 3b6fb0cae1 feat(profile): 实现用户个人中心页面及头像上传功能
添加用户个人中心页面,包含基本信息展示和头像上传功能。主要修改包括:
1. 新增 UserProfileView 页面组件
2. 扩展用户信息接口和类型定义
3. 添加文件上传和头像更新API
4. 配置Vite代理以支持文件服务
5. 添加相关依赖(spark-md5, json-bigint)
2026-01-12 01:41:22 +08:00

56 lines
1.5 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 UserProfileView from "../views/user/UserProfileView.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 },
},
{
path: "/user/profile",
name: "UserProfileView",
component: UserProfileView,
meta: { hideInMenu: true, access: ACCESS_ENUM.USER },
},
];