From 4c7b0bd13305c814ea931a1e06975c134eedd3a1 Mon Sep 17 00:00:00 2001 From: xueyinfei <1207092115@qq.com> Date: Mon, 1 Dec 2025 10:37:04 +0800 Subject: [PATCH] =?UTF-8?q?aichat=E8=B7=B3=E8=BD=AC=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue-fastapi-frontend/src/views/aichat/MdRenderer.vue | 2 +- vue-fastapi-frontend/src/views/aichat/aichat.vue | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/vue-fastapi-frontend/src/views/aichat/MdRenderer.vue b/vue-fastapi-frontend/src/views/aichat/MdRenderer.vue index a3721f2..31c834f 100644 --- a/vue-fastapi-frontend/src/views/aichat/MdRenderer.vue +++ b/vue-fastapi-frontend/src/views/aichat/MdRenderer.vue @@ -21,7 +21,7 @@
- {{'跳转到:'+ item.content.name}} + {{'点击跳转:'+ item.content.name}}
diff --git a/vue-fastapi-frontend/src/views/aichat/aichat.vue b/vue-fastapi-frontend/src/views/aichat/aichat.vue index 0125edd..0e2ca88 100644 --- a/vue-fastapi-frontend/src/views/aichat/aichat.vue +++ b/vue-fastapi-frontend/src/views/aichat/aichat.vue @@ -494,7 +494,6 @@ const getWrite = (reader) => { if (done) return; const decoder = new TextDecoder('utf-8'); let str = decoder.decode(value, { stream: true }); - console.log(str) tempResult += str; // 修复点2:使用非贪婪匹配确保精确分块 @@ -524,7 +523,7 @@ const getWrite = (reader) => { const processChunk = (chunk) => { const lastMsg = chatList.value[chatList.value.length - 1]; - + console.log(chunk) // 修复点5:统一处理所有类型的数据块 if (chunk.docs?.length) { lastMsg.content.push({ content: chunk.docs, type: "docs" }); @@ -534,7 +533,7 @@ const getWrite = (reader) => { lastMsg.content.push({ content: chunk.html_image, type: "html_image" }); } else if (chunk.table?.length) { lastMsg.content.push({ content: chunk.table, type: "table" }); - } else if (chunk.router?.length) { + } else if (chunk.router) { lastMsg.content.push({ content: chunk.router, type: "router" }); } else if (chunk.choices?.length) { // 修复点6:纯文本处理增加防重复校验 @@ -547,7 +546,6 @@ const getWrite = (reader) => { ? content.replace(/\n{2,}/g, '\n\n') : content.replace(/\n/g, ' '); const lastContent = lastMsg.content[lastMsg.content.length - 1]; - console.log(lastContent) if (lastContent?.type === "text") { lastContent.content += text; } else { @@ -558,7 +556,6 @@ const getWrite = (reader) => { // 修复点7:统一处理结束标志 if (chunk.isEnd || chunk.is_end) { lastMsg.isEnd = true; - console.log(lastMsg) lastMsg.time = formatDate(new Date()); }