From 097c544bebb124efc0bdf421046af8908dbcafac Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期五, 20 十二月 2024 13:59:14 +0800 Subject: [PATCH] historyId 问题修复 --- src/components/chat/Chat.vue | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index 40c2553..70de705 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -596,9 +596,8 @@ if (chunkRes.mode === 'summary') { const lastMsg = computedMessageList.value.at(-1); const extraContent = parseExtraContent(chunkRes.value); - // 姝ゅ璇濆凡缁忓姞鍏ュ埌瀵硅瘽鍒楄〃 - if (lastMsg.content && extraContent) { + if (lastMsg.content?.values && extraContent) { for (const key in extraContent) { if (Object.prototype.hasOwnProperty.call(extraContent, key)) { const value = extraContent[key]; @@ -607,6 +606,11 @@ } } } + + lastMsg.historyId = chunkRes.value.history_id; + const userMsg = computedMessageList.value.at(-2); + userMsg.historyId = chunkRes.value.history_id; + userMsg.content.values = chunkRes.value.question; } if (Object.keys(questionRes).length === 0) { @@ -614,7 +618,7 @@ } // 姝ゅ璇濊繕鏈姞鍏ュ埌瀵硅瘽鍒楄〃 - if (!lastMsg.content && questionRes) { + if (!lastMsg.content?.values && questionRes) { questionRes = { ...questionRes, ...chunkRes.value, -- Gitblit v1.9.3