From 5a46bb8d6963783f1f982f209e9559dc09d06172 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Thu, 19 Mar 2026 14:26:32 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E6=99=BA=E8=83=BD=E5=AE=A2?= =?UTF-8?q?=E6=9C=8D=E5=9B=9E=E7=AD=94=E4=B8=8D=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_tool/ai-chat/ai-chat-message.vue | 65 ++++++++++++-------------- scripts/mp-weixin.patch.js | 5 +- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue index dd886bb..cf9160b 100644 --- a/pages_tool/ai-chat/ai-chat-message.vue +++ b/pages_tool/ai-chat/ai-chat-message.vue @@ -875,33 +875,28 @@ export default { }, (completeResult) => { // 流结束回调 - let finalContent = ''; let convId = ''; - - if (typeof completeResult === 'string') { - finalContent = completeResult; - } else { - finalContent = completeResult.content || ''; + + if (typeof completeResult !== 'string') { convId = completeResult.conversation_id || ''; } - - // 更新最终内容 + + // 标记流式结束 streamMessage.isStreaming = false; - streamMessage.content = finalContent; - + // 添加操作按钮 streamMessage.actions = [ { id: 1, text: '有帮助', type: 'like' }, { id: 2, text: '没帮助', type: 'dislike' } ]; - + // 保存会话 ID if (convId) { this.currentConversationId = convId; aiService.setConversationId(convId); this.saveConversationIdToLocal(convId); } - + // 触发事件 this.$emit('ai-response', streamMessage); } @@ -918,30 +913,28 @@ export default { this.$forceUpdate(); }, (completeResult) => { - // 流结束回调 - let finalContent = completeResult?.content || ''; - let convId = completeResult?.conversation_id || ''; - - // 更新最终内容 - streamMessage.isStreaming = false; - streamMessage.content = finalContent; - - // 添加操作按钮 - streamMessage.actions = [ - { id: 1, text: '有帮助', type: 'like' }, - { id: 2, text: '没帮助', type: 'dislike' } - ]; - - // 保存会话 ID - if (convId) { - this.currentConversationId = convId; - aiService.setConversationId(convId); - this.saveConversationIdToLocal(convId); - } - - // 触发事件 - this.$emit('ai-response', streamMessage); - } + // 流结束回调 + let convId = completeResult?.conversation_id || ''; + + // 标记流式结束 + streamMessage.isStreaming = false; + + // 添加操作按钮 + streamMessage.actions = [ + { id: 1, text: '有帮助', type: 'like' }, + { id: 2, text: '没帮助', type: 'dislike' } + ]; + + // 保存会话 ID + if (convId) { + this.currentConversationId = convId; + aiService.setConversationId(convId); + this.saveConversationIdToLocal(convId); + } + + // 触发事件 + this.$emit('ai-response', streamMessage); + } ); // #endif } catch (error) { diff --git a/scripts/mp-weixin.patch.js b/scripts/mp-weixin.patch.js index 43f5032..c877624 100644 --- a/scripts/mp-weixin.patch.js +++ b/scripts/mp-weixin.patch.js @@ -134,8 +134,9 @@ async function main() { // 2) 创建 ZIP 文件(如果未指定 --no-zip) if (!options.noZip) { const cwd = path.join(__dirname, '..'); - const sourceDir = path.join(cwd, 'unpackage', 'dist', 'build', 'mp-weixin'); - const destDir = path.join(cwd, 'unpackage', 'dist', 'build'); + const buildDir = options.mode === 'production' ? 'build' : 'dev'; + const sourceDir = path.join(cwd, 'unpackage', 'dist', buildDir, 'mp-weixin'); + const destDir = path.join(cwd, 'unpackage', 'dist', buildDir); const zipFilePath = await createZipWithSystemCommand(sourceDir, destDir); console.log(`ZIP 文件路径: ${zipFilePath}`);