diff --git a/src/router/base.ts b/src/router/base.ts index a1da586..529d147 100644 --- a/src/router/base.ts +++ b/src/router/base.ts @@ -14,11 +14,15 @@ export const LoginRoute: RouteRecordRaw = { children: [ { path: '/chat', + redirect: `/chat/${Date.now()}` // 重定向到带默认ID的路径 + }, + { + path: '/chat/:id', name: 'chat', component: () => import('@/views/AI/chat/index.vue') }, { - path: '/board', + path: '/board/:id', name: 'board', component: () => import('@/views/chart/index.vue') } diff --git a/src/views/AI/index.vue b/src/views/AI/index.vue index 767d950..c407360 100644 --- a/src/views/AI/index.vue +++ b/src/views/AI/index.vue @@ -44,11 +44,10 @@ const menuList = [ ] const getCurrentRoute = path => { - console.log(route.path, path, 'SSS') - return route.path == path + return route.path.includes(path) } const handlerPath = (path)=>{ - router.push({path:path,query:{id:Date.now()}}) + router.push(path + '/'+ Date.now()) }