From 298f6382343cdfd630d7694e1c66c2bf5fd022ff Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 27 Feb 2024 17:58:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ai=E5=AF=B9=E8=AF=9D,=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=85=B3=E9=97=AD=E8=A2=AB=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=88=B0=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/public/embeb.js | 8 ++++---- ui/src/request/index.ts | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ui/public/embeb.js b/ui/public/embeb.js index 99177b8d4..163969b88 100644 --- a/ui/public/embeb.js +++ b/ui/public/embeb.js @@ -83,11 +83,11 @@ function embedChatbot() { if(is_404){ document.body.removeChild(chat_container) document.body.append(chat_container) + is_404=false - }else{ - chat_container.style['display']='block' - } - + } + chat_container.style['display']='block' + }else{ is_404=true } diff --git a/ui/src/request/index.ts b/ui/src/request/index.ts index d51a3ca19..85354b032 100644 --- a/ui/src/request/index.ts +++ b/ui/src/request/index.ts @@ -56,7 +56,11 @@ instance.interceptors.response.use( router.push('/404 ') } if (err.response?.status === 401) { - router.push({ name: 'login' }) + if (err.response.config.url.includes('chat/open')) { + router.push('/404 ') + } else { + router.push({ name: 'login' }) + } } if (err.response?.status === 403 && !err.response.config.url.includes('chat/open')) {