mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-03 00:00:58 +08:00
135 lines
3.9 KiB
TypeScript
135 lines
3.9 KiB
TypeScript
import type { RouteRecordRaw } from 'vue-router';
|
||
import { HOME_URL } from '@/config';
|
||
|
||
// LayoutRouter[布局路由]
|
||
export const layoutRouter: RouteRecordRaw[] = [
|
||
{
|
||
path: '/',
|
||
redirect: HOME_URL,
|
||
component: () => import('@/layouts/index.vue'),
|
||
children: [
|
||
{
|
||
path: HOME_URL,
|
||
name: 'chat',
|
||
component: () => import('@/pages/chat/index.vue'),
|
||
meta: {
|
||
// title: '通用聊天页面',
|
||
isDefaultChat: true,
|
||
icon: 'HomeFilled',
|
||
// isHide: '1', // 是否在菜单中隐藏[0是,1否] 预留
|
||
// isKeepAlive: '0', // 是否缓存路由数据[0是,1否] 预留
|
||
// isFull: '1', // 是否全屏[0是,1否] 预留
|
||
// enName: "Master Station", // 英文名称 预留
|
||
},
|
||
},
|
||
{
|
||
path: '/chat/:id',
|
||
name: 'chatWithId',
|
||
component: () => import('@/pages/chat/index.vue'),
|
||
meta: {
|
||
// title: '带 ID 的聊天页面',
|
||
isDefaultChat: false,
|
||
},
|
||
},
|
||
{
|
||
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: 'blankPage',
|
||
},
|
||
},
|
||
{
|
||
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',
|
||
},
|
||
},
|
||
],
|
||
},
|
||
|
||
];
|
||
|
||
// 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'),
|
||
},
|
||
];
|