93 lines
2.0 KiB
TypeScript
93 lines
2.0 KiB
TypeScript
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
redirect: '/ai-home',
|
|
},
|
|
{
|
|
path: '/ai-home',
|
|
name: 'AiHome',
|
|
component: () => import('../views/AiHome.vue'),
|
|
meta: { title: 'AI Chat' },
|
|
},
|
|
{
|
|
path: '/dashboard',
|
|
name: 'Dashboard',
|
|
component: () => import('../views/Dashboard.vue'),
|
|
meta: { title: '总览' },
|
|
},
|
|
{
|
|
path: '/ideas',
|
|
name: 'Ideas',
|
|
component: () => import('../views/Ideas.vue'),
|
|
meta: { title: '灵感' },
|
|
},
|
|
{
|
|
path: '/ideas/:id',
|
|
name: 'IdeasDetail',
|
|
component: () => import('../views/Ideas.vue'),
|
|
meta: { title: '灵感详情' },
|
|
},
|
|
{
|
|
path: '/projects',
|
|
name: 'Projects',
|
|
component: () => import('../views/Projects.vue'),
|
|
meta: { title: '项目' },
|
|
},
|
|
{
|
|
path: '/projects/:id',
|
|
name: 'ProjectDetail',
|
|
component: () => import('../views/ProjectDetail.vue'),
|
|
meta: { title: '项目详情' },
|
|
},
|
|
{
|
|
path: '/tasks',
|
|
name: 'Tasks',
|
|
component: () => import('../views/Tasks.vue'),
|
|
meta: { title: '任务' },
|
|
},
|
|
{
|
|
path: '/tasks/:id',
|
|
name: 'TaskDetail',
|
|
component: () => import('../views/TaskDetail.vue'),
|
|
meta: { title: '任务详情' },
|
|
},
|
|
{
|
|
path: '/knowledge',
|
|
name: 'Knowledge',
|
|
component: () => import('../views/Knowledge.vue'),
|
|
meta: { title: '知识库' },
|
|
},
|
|
{
|
|
path: '/audit',
|
|
name: 'AuditLog',
|
|
component: () => import('../views/AuditLog.vue'),
|
|
meta: { title: '审批历史' },
|
|
},
|
|
{
|
|
path: '/settings',
|
|
name: 'Settings',
|
|
component: () => import('../views/Settings.vue'),
|
|
meta: { title: '设置' },
|
|
},
|
|
{
|
|
path: '/ai-detached',
|
|
name: 'AiDetached',
|
|
component: () => import('../views/AiDetached.vue'),
|
|
meta: { title: 'AI Chat' },
|
|
},
|
|
// catch-all:无效路由重定向首页(防白屏)
|
|
{
|
|
path: '/:pathMatch(.*)*',
|
|
redirect: '/',
|
|
},
|
|
]
|
|
|
|
const router = createRouter({
|
|
history: createWebHashHistory(),
|
|
routes,
|
|
})
|
|
|
|
export default router
|