chore:可以正常清空聊天记录

This commit is contained in:
2026-03-12 18:29:11 +08:00
parent fdf85dfec7
commit 4bcf0cbd2d

View File

@@ -1464,6 +1464,22 @@ export default {
this.$emit('location-selected', locationMessage) this.$emit('location-selected', locationMessage)
} }
}) })
},
// 清空聊天记录
clearMessages() {
// 清空消息数组
this.messages = []
// 重置消息 ID
this.messageId = 0
// 清除会话 ID
this.currentConversationId = null
aiService.clearConversationId()
this.clearConversationIdFromLocal()
// 重置历史偏移量
this.historyOffset = 0
// 触发清空事件
this.$emit('messages-cleared')
} }
} }
} }