From 8dc793a128c399bbd96880a9e9768c7eee1feb7d Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed, 9 Apr 2025 19:16:42 +0800 Subject: [PATCH] fix: Historical user conversation data has been cleared (#2840) --- ui/src/components/ai-chat/index.vue | 5 +++++ ui/src/stores/modules/user.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index bdd7780f7..213e373a2 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -243,6 +243,11 @@ function sendMessage(val: string, other_params_data?: any, chat?: chatType) { showUserInput.value = true return }) + } else { + showUserInput.value = false + if (!loading.value && props.applicationDetails?.name) { + handleDebounceClick(val, other_params_data, chat) + } } } diff --git a/ui/src/stores/modules/user.ts b/ui/src/stores/modules/user.ts index 1f98d8045..d7f714d2b 100644 --- a/ui/src/stores/modules/user.ts +++ b/ui/src/stores/modules/user.ts @@ -65,7 +65,11 @@ const useUserStore = defineStore({ if (token) { return token } - return localStorage.getItem(`${this.userAccessToken}accessToken`) + const local_token = localStorage.getItem(`${token}accessToken`) + if (local_token) { + return local_token + } + return localStorage.getItem(`accessToken`) }, getPermissions() {