feat: 消息展示的调整
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user