feat: 消息展示的调整

This commit is contained in:
2026-03-04 22:20:53 +08:00
parent 3f2a4a506b
commit c7a37e6816
4 changed files with 30 additions and 4 deletions

View File

@@ -417,7 +417,6 @@ const handleWebSocketMessage = (data: any) => {
}
if (data.type === 'heartbeat') {
console.log("收到心跳消息:", data);
return;
}
@@ -467,10 +466,12 @@ const handleWebSocketMessage = (data: any) => {
if (chatMsgList.value[aiMsgIndex].isLoading) {
// 首次收到内容:替换“加载中”文案并取消 loading 状态(恢复原始渲染逻辑)
chatMsgList.value[aiMsgIndex].messageContent = data.content;
chatMsgList.value[aiMsgIndex].messageContentList = [data.content];
chatMsgList.value[aiMsgIndex].isLoading = false;
} else {
// 后续流式内容追加
chatMsgList.value[aiMsgIndex].messageContent += data.content;
chatMsgList.value[aiMsgIndex].messageContentList.push(data.content);
}
nextTick(() => scrollToBottom());
}
@@ -492,7 +493,7 @@ const handleWebSocketMessage = (data: any) => {
chatMsgList.value[aiMsgIndex].messageContent = "";
}
}
// 处理toolCall
if (data.toolCall) {
chatMsgList.value[aiMsgIndex].toolCall = data.toolCall;