From c08cef076532cb26ff114b1d7870ba71e8bd78ca Mon Sep 17 00:00:00 2001 From: RockYang Date: Wed, 19 Apr 2023 19:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B8=85=E7=A9=BA=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E8=AE=B0=E5=BD=95=E5=92=8C=E9=80=80=E5=87=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/storage.js | 4 ++ web/src/views/ChatFree.vue | 143 ++++++++++++++++++++++++++++++------- 2 files changed, 120 insertions(+), 27 deletions(-) diff --git a/web/src/utils/storage.js b/web/src/utils/storage.js index b8ede43d..41489721 100644 --- a/web/src/utils/storage.js +++ b/web/src/utils/storage.js @@ -53,6 +53,10 @@ export function appendChatHistory(chatId, message) { Storage.set(ChatHistoryKey, history); } +export function clearChatHistory() { + Storage.remove(ChatHistoryKey); +} + // 获取指定会话的历史记录 export function getChatHistory(chatId) { const history = Storage.get(ChatHistoryKey); diff --git a/web/src/views/ChatFree.vue b/web/src/views/ChatFree.vue index fcb69fdb..5879f3e9 100644 --- a/web/src/views/ChatFree.vue +++ b/web/src/views/ChatFree.vue @@ -1,13 +1,16 @@