Files
Yi.Framework/Yi.Ai.Vue3/src/routers/modules/staticRouter.ts
2025-12-31 00:02:25 +08:00

264 lines
7.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { RouteRecordRaw } from 'vue-router';
// LayoutRouter[布局路由]
export const layoutRouter: RouteRecordRaw[] = [
{
path: '/',
component: () => import('@/layouts/index.vue'),
children: [
// 将首页重定向逻辑放在这里
{
path: '',
redirect: '/chat/conversation',
},
// chat 路由组 - 修正路径和重定向
{
path: 'chat',
name: 'chat',
component: () => import('@/pages/chat/index.vue'),
meta: {
title: 'AI聊天',
icon: 'HomeFilled',
},
children: [
// chat 根路径重定向到 conversation
{
path: '',
redirect: '/chat/conversation',
},
{
path: 'conversation',
name: 'chatConversation',
component: () => import('@/pages/chat/conversation/index.vue'),
meta: {
title: 'AI对话',
isDefaultChat: true,
},
},
{
path: 'conversation/:id',
name: 'chatConversationWithId',
component: () => import('@/pages/chat/conversation/index.vue'),
meta: {
title: 'AI对话',
isDefaultChat: false,
},
},
{
path: 'image',
name: 'chatImage',
component: () => import('@/pages/chat/image/index.vue'),
meta: {
title: '图片生成',
},
},
{
path: 'video',
name: 'chatVideo',
component: () => import('@/pages/chat/video/index.vue'),
meta: {
title: '视频生成',
},
},
],
},
// 产品页面
{
path: 'products',
name: 'products',
component: () => import('@/pages/products/index.vue'),
meta: {
title: '产品页面',
keepAlive: 0,
isDefaultChat: false,
layout: 'blankPage',
},
},
// 模型库
{
path: 'model-library',
name: 'modelLibrary',
component: () => import('@/pages/modelLibrary/index.vue'),
meta: {
title: '模型库',
keepAlive: 0,
isDefaultChat: false,
layout: 'default',
},
},
// 支付结果
{
path: 'pay-result',
name: 'payResult',
component: () => import('@/pages/payResult/index.vue'),
meta: {
title: '支付结果',
keepAlive: 0,
isDefaultChat: false,
layout: 'blankPage',
},
},
// 活动详情
{
path: 'activity/:id',
name: 'activityDetail',
component: () => import('@/pages/activity/detail.vue'),
meta: {
title: '活动详情',
isDefaultChat: false,
layout: 'blankPage',
},
},
// 公告详情
{
path: 'announcement/:id',
name: 'announcementDetail',
component: () => import('@/pages/announcement/detail.vue'),
meta: {
title: '公告详情',
isDefaultChat: false,
layout: 'blankPage',
},
},
// 控制台路由组 - 修正路径和重定向
{
path: 'console',
name: 'console',
component: () => import('@/pages/console/index.vue'),
meta: {
title: '控制台',
icon: 'Setting',
layout: 'default',
},
children: [
// console 根路径重定向到 user
{
path: '',
redirect: '/console/user',
},
{
path: 'user',
name: 'consoleUser',
component: () => import('@/components/userPersonalCenter/components/UserManagement.vue'),
meta: {
title: '用户信息',
},
},
{
path: 'apikey',
name: 'consoleApikey',
component: () => import('@/components/userPersonalCenter/components/APIKeyManagement.vue'),
meta: {
title: 'API密钥',
},
},
{
path: 'recharge-log',
name: 'consoleRechargeLog',
component: () => import('@/components/userPersonalCenter/components/RechargeLog.vue'),
meta: {
title: '充值记录',
},
},
{
path: 'usage',
name: 'consoleUsage',
component: () => import('@/components/userPersonalCenter/components/UsageStatistics.vue'),
meta: {
title: '用量统计',
},
},
{
path: 'premium',
name: 'consolePremium',
component: () => import('@/components/userPersonalCenter/components/PremiumService.vue'),
meta: {
title: '尊享服务',
},
},
{
path: 'daily-task',
name: 'consoleDailyTask',
component: () => import('@/components/userPersonalCenter/components/DailyTask.vue'),
meta: {
title: '每日任务',
},
},
{
path: 'invite',
name: 'consoleInvite',
component: () => import('@/components/userPersonalCenter/components/CardFlipActivity.vue'),
meta: {
title: '每周邀请',
},
},
{
path: 'activation',
name: 'consoleActivation',
component: () => import('@/components/userPersonalCenter/components/ActivationCode.vue'),
meta: {
title: '激活码兑换',
},
},
{
path: 'channel',
name: 'consoleChannel',
component: () => import('@/pages/console/channel/index.vue'),
meta: {
title: '渠道商管理',
},
},
],
},
],
},
];
// staticRouter[静态路由] 预留
export const staticRouter: RouteRecordRaw[] = [];
// errorRouter (错误页面路由)
export const errorRouter = [
{
path: '/403',
name: '403',
component: () => import('@/pages/error/403.vue'),
meta: {
title: '403页面',
enName: '403 Page', // 英文名称
icon: 'QuestionFilled', // 菜单图标
isHide: '1', // 代表路由在菜单中是否隐藏,是否隐藏[0隐藏1显示]
isLink: '1', // 是否外链[有值则是外链]
isKeepAlive: '0', // 是否缓存路由数据[0是1否]
isFull: '1', // 是否缓存全屏[0是1否]
isAffix: '1', // 是否缓存固定路由[0是1否]
},
},
{
path: '/404',
name: '404',
component: () => import('@/pages/error/404.vue'),
meta: {
title: '404页面',
enName: '404 Page', // 英文名称
icon: 'CircleCloseFilled', // 菜单图标
isHide: '1', // 代表路由在菜单中是否隐藏,是否隐藏[0隐藏1显示]
isLink: '1', // 是否外链[有值则是外链]
isKeepAlive: '0', // 是否缓存路由数据[0是1否]
isFull: '1', // 是否缓存全屏[0是1否]
isAffix: '1', // 是否缓存固定路由[0是1否]
},
},
// 找不到path将跳转404页面
{
path: '/:pathMatch(.*)*',
component: () => import('@/pages/error/404.vue'),
},
];