优化: P2低风险收尾(router404+meta.icon清理+ErrorBoundary接入)
This commit is contained in:
@@ -3,14 +3,18 @@
|
||||
<!-- 主窗口:页面内容(router-view + 页面切换过渡) -->
|
||||
<router-view v-slot="{ Component }">
|
||||
<transition name="page" mode="out-in">
|
||||
<ErrorBoundary :key="route.path">
|
||||
<component :is="Component" />
|
||||
</ErrorBoundary>
|
||||
</transition>
|
||||
</router-view>
|
||||
|
||||
<!-- 分离窗口:纯内容 -->
|
||||
<template #detached>
|
||||
<router-view v-slot="{ Component }">
|
||||
<ErrorBoundary :key="route.path">
|
||||
<component :is="Component" />
|
||||
</ErrorBoundary>
|
||||
</router-view>
|
||||
</template>
|
||||
|
||||
@@ -35,6 +39,7 @@ import { useProjectStore } from './stores/project'
|
||||
import { useAppSettingsStore } from './stores/appSettings'
|
||||
import i18n from './i18n'
|
||||
import AiChat from './components/AiChat.vue'
|
||||
import ErrorBoundary from './components/ErrorBoundary.vue'
|
||||
import AppLayout from './components/layout/AppLayout.vue'
|
||||
import { aiApi } from '@/api'
|
||||
|
||||
|
||||
@@ -15,67 +15,72 @@ const routes = [
|
||||
path: '/dashboard',
|
||||
name: 'Dashboard',
|
||||
component: () => import('../views/Dashboard.vue'),
|
||||
meta: { title: '总览', icon: 'icon-dashboard' },
|
||||
meta: { title: '总览' },
|
||||
},
|
||||
{
|
||||
path: '/ideas',
|
||||
name: 'Ideas',
|
||||
component: () => import('../views/Ideas.vue'),
|
||||
meta: { title: '灵感', icon: 'icon-lightbulb' },
|
||||
meta: { title: '灵感' },
|
||||
},
|
||||
{
|
||||
path: '/ideas/:id',
|
||||
name: 'IdeasDetail',
|
||||
component: () => import('../views/Ideas.vue'),
|
||||
meta: { title: '灵感详情', icon: 'icon-lightbulb' },
|
||||
meta: { title: '灵感详情' },
|
||||
},
|
||||
{
|
||||
path: '/projects',
|
||||
name: 'Projects',
|
||||
component: () => import('../views/Projects.vue'),
|
||||
meta: { title: '项目', icon: 'icon-apps' },
|
||||
meta: { title: '项目' },
|
||||
},
|
||||
{
|
||||
path: '/projects/:id',
|
||||
name: 'ProjectDetail',
|
||||
component: () => import('../views/ProjectDetail.vue'),
|
||||
meta: { title: '项目详情', icon: 'icon-apps' },
|
||||
meta: { title: '项目详情' },
|
||||
},
|
||||
{
|
||||
path: '/tasks',
|
||||
name: 'Tasks',
|
||||
component: () => import('../views/Tasks.vue'),
|
||||
meta: { title: '任务', icon: 'icon-thunder' },
|
||||
meta: { title: '任务' },
|
||||
},
|
||||
{
|
||||
path: '/tasks/:id',
|
||||
name: 'TaskDetail',
|
||||
component: () => import('../views/TaskDetail.vue'),
|
||||
meta: { title: '任务详情', icon: 'icon-thunder' },
|
||||
meta: { title: '任务详情' },
|
||||
},
|
||||
{
|
||||
path: '/knowledge',
|
||||
name: 'Knowledge',
|
||||
component: () => import('../views/Knowledge.vue'),
|
||||
meta: { title: '知识库', icon: 'icon-book' },
|
||||
meta: { title: '知识库' },
|
||||
},
|
||||
{
|
||||
path: '/audit',
|
||||
name: 'AuditLog',
|
||||
component: () => import('../views/AuditLog.vue'),
|
||||
meta: { title: '审批历史', icon: 'icon-audit' },
|
||||
meta: { title: '审批历史' },
|
||||
},
|
||||
{
|
||||
path: '/settings',
|
||||
name: 'Settings',
|
||||
component: () => import('../views/Settings.vue'),
|
||||
meta: { title: '设置', icon: 'icon-settings' },
|
||||
meta: { title: '设置' },
|
||||
},
|
||||
{
|
||||
path: '/ai-detached',
|
||||
name: 'AiDetached',
|
||||
component: () => import('../views/AiDetached.vue'),
|
||||
meta: { title: 'AI Chat', icon: 'icon-ai' },
|
||||
meta: { title: 'AI Chat' },
|
||||
},
|
||||
// catch-all:无效路由重定向首页(防白屏)
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: '/',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user