chore: 优化部份实现

This commit is contained in:
ChenZhaoYu
2023-02-14 15:37:18 +08:00
parent de34af8747
commit 701ef0e6e1
3 changed files with 30 additions and 28 deletions

View File

@@ -4,15 +4,6 @@ export function useChat() {
const historyStore = useHistoryStore()
function addChat(message: string, args?: { reversal?: boolean; error?: boolean; options?: Chat.ChatOptions }) {
if (historyStore.historyChat.length === 0) {
historyStore.addHistory({
title: message,
isEdit: false,
data: [],
})
historyStore.chooseHistory(historyStore.historyChat.length - 1)
}
historyStore.addChat({
dateTime: new Date().toLocaleString(),
message,