From 7683817deeae31e01024ab9b087a1d6f2b4b8768 Mon Sep 17 00:00:00 2001 From: xuhongjie <1943105267@qq.com> Date: Mon, 14 Apr 2025 15:00:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=8F=82=E6=95=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/base.ts | 6 +++++- src/views/AI/index.vue | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) 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()) }