From 9143a86f51328ba726704641370efbc2a0862f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Thu, 27 Feb 2025 15:22:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=3D=E5=8E=BB=E9=99=A4=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E6=97=B6=E5=86=97=E4=BD=99=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/server.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apis/server.ts b/src/apis/server.ts index 4d41086..0acc4e8 100644 --- a/src/apis/server.ts +++ b/src/apis/server.ts @@ -63,6 +63,9 @@ server.interceptors.response.use( return Promise.resolve(response); }, async (error: AxiosError) => { + if(error.config?.url==="/api/app/recent"){ + return; + } ElMessage({ showClose: true, message: error?.response?.data?.message || error.message, -- Gitee From 8908b0c151094655f68844af6470987dbd07e848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Thu, 27 Feb 2025 16:02:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81=E4=BC=98=E5=8C=96=EF=BC=9A=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=BA=94=E7=94=A8=E5=AF=B9=E8=AF=9D=E5=92=8C=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=BA=94=E7=94=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 2 +- src/views/dialogue/dialogueView.vue | 75 +++++++++++++++++++++-------- 2 files changed, 56 insertions(+), 21 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index cbad9bf..e223569 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -22,7 +22,7 @@ const router = createRouter({ }, { path: '/login', - name: 'dialogue-login', + name: 'login', component: (): Promise => import('src/views/dialogue/Copilot.vue'), }, diff --git a/src/views/dialogue/dialogueView.vue b/src/views/dialogue/dialogueView.vue index 4860212..3d1be34 100644 --- a/src/views/dialogue/dialogueView.vue +++ b/src/views/dialogue/dialogueView.vue @@ -49,11 +49,44 @@ const isSubmitDisabled = ref(true); const ruleFormRef = ref(); const router = useRouter(); const type = import.meta.env.VITE_USER_TYPE; -const routerList = [ - { name: '对话', path: '/' , src:CopilotIcon , selectedSrc:CopilotIconSelected ,routerName: 'dialogue' }, - { name: '语义中心', path: '/api' , src:ApiIcon , selectedSrc:ApiIconSelected ,routerName: 'api' }, - { name: '应用中心', path: '/app' , src:AppIcon , selectedSrc:AppIconSelected ,routerName: 'app' }, - { name: '知识库', path: '/witchainD' , src:WitchainDIcon , selectedSrc:WitchainDIconSelected ,routerName: 'witchainD' }, +const routerList: Array<{ + name: string; + path: string; + src: string; + selectedSrc: string; + routerName: string; + anotherName?: string | undefined; // 路由别名,辅助匹配选中的路由图标 +}> = [ + { + name: '对话', + path: '/', + src: CopilotIcon, + selectedSrc: CopilotIconSelected, + routerName: 'dialogue', + anotherName: 'copilot', + }, + { + name: '语义中心', + path: '/api', + src: ApiIcon, + selectedSrc: ApiIconSelected, + routerName: 'api', + }, + { + name: '应用中心', + path: '/app', + src: AppIcon, + selectedSrc: AppIconSelected, + routerName: 'app', + anotherName: 'createApp', + }, + { + name: '知识库', + path: '/witchainD', + src: WitchainDIcon, + selectedSrc: WitchainDIconSelected, + routerName: 'witchainD', + }, ]; export interface ModelForm { @@ -185,9 +218,9 @@ onMounted(() => { if (localStorage.getItem('kb_id')) { ruleForm.kb_id = localStorage.getItem('kb_id'); } - console.log('onMounted',window.location.host); + console.log('onMounted', window.location.host); const iframe = document.getElementById('my-iframe'); - console.log('iframe',`${window.location.origin}/witchaind`); + console.log('iframe', `${window.location.origin}/witchaind`); iframe.src = `${window.location.origin}/witchaind`; initCopilot(); // iframe.src = `http://localhost:3002`; @@ -230,28 +263,27 @@ const initCopilot = async (): Promise => { }; } userinfo.value.organization = type; - const isLogin = await getUserInfo(); - if (isLogin) { - await api.stopGeneration(); - await getHistorySession(); + const isLogin = await getUserInfo(); + if (isLogin) { + await api.stopGeneration(); + await getHistorySession(); } - return; + return; }; watch( () => router, () => { - const currRoute = router.currentRoute; - if (currRoute.value.query.appId) { - app.value = { - appId: String(currRoute.value.query.appId), - name: String(currRoute.value.query.name), - }; + const currRoute = router.currentRoute; + if (currRoute.value.query.appId) { + app.value = { + appId: String(currRoute.value.query.appId), + name: String(currRoute.value.query.name), + }; } }, { deep: true, immediate: true }, ); -