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