diff --git a/frontend/app/web-gold/src/App.vue b/frontend/app/web-gold/src/App.vue index f8b3c7cb6b..7f4339f066 100644 --- a/frontend/app/web-gold/src/App.vue +++ b/frontend/app/web-gold/src/App.vue @@ -1,8 +1,6 @@ + + + + diff --git a/frontend/app/web-gold/src/router/index.js b/frontend/app/web-gold/src/router/index.js index c1cd13fedf..6c6ed67baf 100644 --- a/frontend/app/web-gold/src/router/index.js +++ b/frontend/app/web-gold/src/router/index.js @@ -1,13 +1,10 @@ import { createRouter, createWebHistory } from 'vue-router' import { useUserStore } from '@/stores/user' import tokenManager from '@gold/utils/token-manager' +import MainLayout from '@/layouts/MainLayout.vue' const routes = [ - { - path: '/', - redirect: '/content-style/benchmark' - }, - // 登录页面 + // 登录页面 - 独立渲染,不使用Layout { path: '/login', name: '登录', @@ -16,62 +13,72 @@ const routes = [ requiresAuth: false } }, - // { path: '/home', name: '首页', component: () => import('../views/home/Home.vue') }, + // 主布局路由 - 所有需要Layout的页面都在这里 { - path: '/content-style', - name: '内容风格分析', + path: '/', + component: MainLayout, + redirect: '/content-style/benchmark', children: [ - { path: '', redirect: '/content-style/benchmark' }, - { path: 'benchmark', name: '对标分析', component: () => import('../views/content-style/Benchmark.vue') }, - { path: 'copywriting', name: '文案创作', component: () => import('../views/content-style/Copywriting.vue') }, - ] - }, - { - path: '/trends', - name: '热点趋势分析', - children: [ - { path: '', redirect: '/trends/heat' }, - { path: 'heat', name: '热度分析', component: () => import('../views/trends/Heat.vue') }, - { path: 'forecast', name: '热点预测', component: () => import('../views/trends/Forecast.vue') }, - { path: 'copywriting', name: '趋势文案创作', component: () => import('../views/trends/Copywriting.vue') }, - ] - }, - { - path: '/digital-human', - name: '数字人', - children: [ - { path: '', redirect: '/digital-human/voice-copy' }, - { path: 'voice-copy', name: '人声克隆', component: () => import('../views/dh/VoiceCopy.vue') }, - { path: 'avatar', name: '生成数字人', component: () => import('../views/dh/Avatar.vue') }, - { path: 'video', name: '数字人视频', component: () => import('../views/dh/Video.vue') }, - ] - }, - { - path: '/material', - name: '素材库', - children: [ - { path: '', redirect: '/material/list' }, - { path: 'list', name: '素材列表', component: () => import('../views/material/MaterialList.vue') }, - { path: 'mix-task', name: '混剪任务', component: () => import('../views/material/MixTaskList.vue') }, - { path: 'group', name: '素材分组', component: () => import('../views/material/MaterialGroup.vue') }, - ] - }, - { - path: '/system', - name: '系统', - children: [ - { path: '', redirect: '/system/style-settings' }, - { path: 'style-settings', name: '风格设置', component: () => import('../views/system/StyleSettings.vue') }, + { + path: 'content-style', + name: '内容风格分析', + children: [ + { path: '', redirect: '/content-style/benchmark' }, + { path: 'benchmark', name: '对标分析', component: () => import('../views/content-style/Benchmark.vue') }, + { path: 'copywriting', name: '文案创作', component: () => import('../views/content-style/Copywriting.vue') }, + ] + }, + { + path: 'trends', + name: '热点趋势分析', + children: [ + { path: '', redirect: '/trends/heat' }, + { path: 'heat', name: '热度分析', component: () => import('../views/trends/Heat.vue') }, + { path: 'forecast', name: '热点预测', component: () => import('../views/trends/Forecast.vue') }, + { path: 'copywriting', name: '趋势文案创作', component: () => import('../views/trends/Copywriting.vue') }, + ] + }, + { + path: 'digital-human', + name: '数字人', + children: [ + { path: '', redirect: '/digital-human/voice-copy' }, + { path: 'voice-copy', name: '人声克隆', component: () => import('../views/dh/VoiceCopy.vue') }, + { path: 'avatar', name: '生成数字人', component: () => import('../views/dh/Avatar.vue') }, + { path: 'video', name: '数字人视频', component: () => import('../views/dh/Video.vue') }, + ] + }, + { + path: 'material', + name: '素材库', + children: [ + { path: '', redirect: '/material/list' }, + { path: 'list', name: '素材列表', component: () => import('../views/material/MaterialList.vue') }, + { path: 'mix-task', name: '混剪任务', component: () => import('../views/material/MixTaskList.vue') }, + { path: 'group', name: '素材分组', component: () => import('../views/material/MaterialGroup.vue') }, + ] + }, + { + path: 'system', + name: '系统', + children: [ + { path: '', redirect: '/system/style-settings' }, + { path: 'style-settings', name: '风格设置', component: () => import('../views/system/StyleSettings.vue') }, + ], + meta: { + requiresAuth: true + } + }, + { path: 'realtime-hot', name: '实时热点推送', component: () => import('../views/realtime/RealtimeHot.vue') }, + { path: 'capcut-import', name: '剪映导入', component: () => import('../views/capcut/CapcutImport.vue') }, + { path: 'help', name: '帮助', component: () => import('../views/misc/Help.vue') }, + { path: 'download', name: '下载', component: () => import('../views/misc/Download.vue') }, + { path: 'settings/theme', name: '主题设置', component: () => import('../views/misc/Theme.vue') }, ], meta: { requiresAuth: true } }, - { path: '/realtime-hot', name: '实时热点推送', component: () => import('../views/realtime/RealtimeHot.vue') }, - { path: '/capcut-import', name: '剪映导入', component: () => import('../views/capcut/CapcutImport.vue') }, - { path: '/help', name: '帮助', component: () => import('../views/misc/Help.vue') }, - { path: '/download', name: '下载', component: () => import('../views/misc/Download.vue') }, - { path: '/settings/theme', name: '主题设置', component: () => import('../views/misc/Theme.vue') }, ] const router = createRouter({