fix: 前端页面架构重构初版

This commit is contained in:
Gsh
2025-12-28 22:42:17 +08:00
parent 4b9f845fae
commit 411a9058ca
53 changed files with 6098 additions and 845 deletions

View File

@@ -1,38 +1,72 @@
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,
path: '',
redirect: '/chat/conversation',
},
// chat 路由组 - 修正路径和重定向
{
path: 'chat',
name: 'chat',
component: () => import('@/pages/chat/index.vue'),
meta: {
// title: '通用聊天页面',
isDefaultChat: true,
title: 'AI聊天',
icon: 'HomeFilled',
// isHide: '1', // 是否在菜单中隐藏[0是1否] 预留
// isKeepAlive: '0', // 是否缓存路由数据[0是1否] 预留
// isFull: '1', // 是否全屏[0是1否] 预留
// enName: "Master Station", // 英文名称 预留
},
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: '/chat/:id',
name: 'chatWithId',
component: () => import('@/pages/chat/index.vue'),
meta: {
// title: '带 ID 的聊天页面',
isDefaultChat: false,
},
},
{
path: '/products',
path: 'products',
name: 'products',
component: () => import('@/pages/products/index.vue'),
meta: {
@@ -41,33 +75,37 @@ export const layoutRouter: RouteRecordRaw[] = [
isDefaultChat: false,
layout: 'blankPage',
},
},
// 模型库
{
path: '/model-library',
path: 'model-library',
name: 'modelLibrary',
component: () => import('@/pages/modelLibrary/index.vue'),
meta: {
title: '模型库',
keepAlive: 0,
isDefaultChat: false,
layout: 'blankPage',
layout: 'default',
},
},
// 支付结果
{
path: '/pay-result',
path: 'pay-result',
name: 'payResult',
component: () => import('@/pages/payResult/index.vue'),
meta: {
title: '支付结果',
keepAlive: 0, // 如果需要缓存
isDefaultChat: false, // 根据实际情况设置
layout: 'blankPage', // 如果需要自定义布局
keepAlive: 0,
isDefaultChat: false,
layout: 'blankPage',
},
},
// 活动详情
{
path: '/activity/:id',
path: 'activity/:id',
name: 'activityDetail',
component: () => import('@/pages/activity/detail.vue'),
meta: {
@@ -76,8 +114,10 @@ export const layoutRouter: RouteRecordRaw[] = [
layout: 'blankPage',
},
},
// 公告详情
{
path: '/announcement/:id',
path: 'announcement/:id',
name: 'announcementDetail',
component: () => import('@/pages/announcement/detail.vue'),
meta: {
@@ -86,11 +126,92 @@ export const layoutRouter: RouteRecordRaw[] = [
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: '激活码兑换',
},
},
],
},
],
},
];
// staticRouter[静态路由] 预留
export const staticRouter: RouteRecordRaw[] = [];