优化聊天记录

This commit is contained in:
Leo_Ding 2025-08-07 13:13:39 +08:00
parent eea635e7bd
commit 98e9cf72e7

View File

@ -149,9 +149,7 @@
if (!text || text.trim() === '') return; if (!text || text.trim() === '') return;
// //
const isThinking = text.includes('<think>') || const isThinking = text.includes('<think>') ||(this.messages[this.messages.length - 1]?.type === 'thinking');
(this.messages[this.messages.length - 1]?.type === 'thinking');
if (isThinking) { if (isThinking) {
this.handleThinkingContent(text); this.handleThinkingContent(text);
} else { } else {
@ -209,7 +207,7 @@
if (this.messages.length > 0) { if (this.messages.length > 0) {
const lastMsg = this.messages[this.messages.length - 1]; const lastMsg = this.messages[this.messages.length - 1];
lastMsg.isComplete = true; lastMsg.isComplete = true;
lastMsg.isTyping=false
// //
if (lastMsg.type === 'thinking') { if (lastMsg.type === 'thinking') {
return; return;
@ -267,7 +265,7 @@
success: () => { success: () => {
console.log('消息发送成功'); console.log('消息发送成功');
// //
this.addMessage('bot', '思考中...', true); this.addMessage('bot', '思考中...','thinking',true);
}, },
fail: (err) => { fail: (err) => {
console.error('消息发送失败', err); console.error('消息发送失败', err);
@ -374,6 +372,7 @@
.message-text { .message-text {
font-size: 14px; font-size: 14px;
line-height: 1.4; line-height: 1.4;
color: #333333;
} }
.chat-input { .chat-input {