From ee407e95f1a4d3b66049955e04a6a354f9cf1679 Mon Sep 17 00:00:00 2001 From: wency_cai <> Date: Mon, 25 Aug 2025 10:39:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=AB=AF=E6=B5=81=E5=BC=8F=E8=BE=93=E5=87=BA=E6=80=9D=E8=80=83?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/chat/layouts/chatWithId/index.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/chat/layouts/chatWithId/index.vue b/src/pages/chat/layouts/chatWithId/index.vue index ce3d6c2..b873ce2 100644 --- a/src/pages/chat/layouts/chatWithId/index.vue +++ b/src/pages/chat/layouts/chatWithId/index.vue @@ -48,13 +48,13 @@ const { stream, loading: isLoading, cancel } = useHookFetch({ console.warn('测试错误拦截', err); }, }); -// 记录进入思考中 -let isThinking = false; +// // 记录进入思考中 +// let isThinking = false; watch( () => route.params?.id, async (_id_) => { - if (_id_) { + if (_id_ && _id_ !== 'undefined') { if (_id_ !== 'not_login') { // 判断的当前会话id是否有聊天记录,有缓存则直接赋值展示 if (chatStore.chatMap[`${_id_}`] && chatStore.chatMap[`${_id_}`].length) { @@ -96,6 +96,8 @@ watch( // 封装数据处理逻辑 function handleDataChunk(chunk: AnyObject) { try { + // 记录是否进入思考中 + let isThinking = false; const reasoningChunk = chunk.choices?.[0].delta.reasoning_content; if (reasoningChunk) { // 开始思考链状态 @@ -117,7 +119,7 @@ function handleDataChunk(chunk: AnyObject) { isThinking = true; } if (thinkEnd) { - isThinking = false; + isThinking = true; } if (isThinking) { // 开始思考链状态