feat(v3): Web 应用化基线(异步任务/SSE/llama-server 管理/Vue SPA 四页 + 设置页整页滚动修复)
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import ChatView from '@/views/ChatView.vue'
|
||||
|
||||
// Vite 构建时 base=/static/,但 FastAPI 在 /metrics 等路径提供 SPA(不在 /static/ 下),
|
||||
// 所以 history 固定用 '/',避免 Vue Router 把 /metrics 当作 /static/metrics 解析导致路由不匹配。
|
||||
const router = createRouter({
|
||||
history: createWebHistory('/'),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/chat',
|
||||
},
|
||||
{
|
||||
path: '/chat',
|
||||
name: 'chat',
|
||||
component: ChatView,
|
||||
},
|
||||
{
|
||||
path: '/collaboration',
|
||||
name: 'collaboration',
|
||||
component: () => import('@/views/CollaborationView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/review',
|
||||
name: 'review',
|
||||
component: () => import('@/views/ReviewView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/metrics',
|
||||
name: 'metrics',
|
||||
component: () => import('@/views/MetricsView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/settings',
|
||||
name: 'settings',
|
||||
component: () => import('@/views/SettingsView.vue'),
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user