From 7b0ed4e88b6c5656cce920c38a6aa693b5d88245 Mon Sep 17 00:00:00 2001 From: sophie <16087569+sophie_liang@user.noreply.gitee.com> Date: Fri, 17 Apr 2026 18:55:58 +0800 Subject: [PATCH] fix build error --- frontend/dist/index.html | 7 +++---- frontend/src/composables/useChat.ts | 14 ++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 20ade220..c560aebf 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -1,4 +1,4 @@ - + @@ -10,11 +10,10 @@ AI工作台 - - + +
- diff --git a/frontend/src/composables/useChat.ts b/frontend/src/composables/useChat.ts index fbee2eb0..7e72d3e9 100644 --- a/frontend/src/composables/useChat.ts +++ b/frontend/src/composables/useChat.ts @@ -256,8 +256,11 @@ export function useChat() { total: botMsg.content.length, }); } - if (botMsgIndex !== null && messages.value[botMsgIndex]) { - applyEventMetadata(messages.value[botMsgIndex], data); + if (botMsgIndex !== null) { + const currentBotMsg = messages.value[botMsgIndex]; + if (currentBotMsg) { + applyEventMetadata(currentBotMsg, data); + } } } else if (data.event === 'message_end') { if (data.conversation_id) { @@ -273,8 +276,11 @@ export function useChat() { total: botMsg.content.length, }); } - if (botMsgIndex !== null && messages.value[botMsgIndex]) { - applyEventMetadata(messages.value[botMsgIndex], data); + if (botMsgIndex !== null) { + const currentBotMsg = messages.value[botMsgIndex]; + if (currentBotMsg) { + applyEventMetadata(currentBotMsg, data); + } } } else if (data.event === 'error') { const botMsg = ensureBotMessage();