优化聊天记录

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