From ecce182a2080da992392ef8e1c608cf6ab096d80 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Mon, 17 Jul 2023 22:05:45 +0800 Subject: [PATCH] code --- client/src/api/fetch.ts | 4 +- client/src/components/ChatBox/index.tsx | 2 +- .../Icon/icons/light/customTitle.svg | 1 + client/src/components/Icon/index.tsx | 3 +- client/src/components/Layout/navbarPhone.tsx | 6 +- client/src/constants/app.ts | 1374 ----------------- client/src/constants/flow/ModuleTemplate.ts | 1290 +++++++++++++++- client/src/pages/api/admin/initv4.ts | 52 +- client/src/pages/api/app/modules/chat/gpt.ts | 3 +- .../components/edit/components/NodeChat.tsx | 34 +- .../app/detail/components/edit/index.tsx | 7 +- .../pages/app/list/component/CreateModal.tsx | 3 +- .../chat/components/ChatHistorySlider.tsx | 18 +- client/src/pages/chat/components/ToolMenu.tsx | 4 +- client/src/pages/chat/index.tsx | 14 + client/src/service/api/request.ts | 2 +- 16 files changed, 1395 insertions(+), 1422 deletions(-) create mode 100644 client/src/components/Icon/icons/light/customTitle.svg diff --git a/client/src/api/fetch.ts b/client/src/api/fetch.ts index 2564d76ef..d0dd4811e 100644 --- a/client/src/api/fetch.ts +++ b/client/src/api/fetch.ts @@ -89,6 +89,8 @@ export const streamFetch = ({ }); read(); } catch (err: any) { + console.log(111111111111111111); + if (err?.message === 'The user aborted a request.') { return resolve({ responseText, @@ -102,7 +104,7 @@ export const streamFetch = ({ }; read(); } catch (err: any) { - console.log(err); + console.log(err, 'fetch error'); reject(getErrText(err, '请求异常')); } diff --git a/client/src/components/ChatBox/index.tsx b/client/src/components/ChatBox/index.tsx index 014379227..bf54bf36b 100644 --- a/client/src/components/ChatBox/index.tsx +++ b/client/src/components/ChatBox/index.tsx @@ -464,7 +464,7 @@ const ChatBox = ( source={item.value} isChatting={index === chatHistory.length - 1 && isChatting} /> - {(item[quoteLenKey] || item[rawSearchKey]?.length) && ( + {(!!item[quoteLenKey] || !!item[rawSearchKey]?.length) && (