fix: Historical user conversation data has been cleared (#2843)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2025-04-10 09:48:14 +08:00 committed by GitHub
parent 8dc793a128
commit 0213aff12a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -271,7 +271,7 @@ const props = withDefaults(
showUserInput?: boolean
sendMessage: (question: string, other_params_data?: any, chat?: chatType) => void
openChatId: () => Promise<string>
validate: () => Promise<boolean | string>
validate: () => Promise<any>
}>(),
{
applicationDetails: () => ({}),

View File

@ -97,8 +97,8 @@ const useApplicationStore = defineStore({
applicationApi
.postAppAuthentication(token, loading, authentication_value)
.then((res) => {
localStorage.setItem(`${token}accessToken`, res.data)
sessionStorage.setItem(`${token}accessToken`, res.data)
localStorage.setItem(`${token}-accessToken`, res.data)
sessionStorage.setItem(`${token}-accessToken`, res.data)
resolve(res)
})
.catch((error) => {

View File

@ -61,11 +61,11 @@ const useUserStore = defineStore({
return this.userType === 1 ? localStorage.getItem('token') : this.getAccessToken()
},
getAccessToken() {
const token = sessionStorage.getItem(`${this.userAccessToken}accessToken`)
const token = sessionStorage.getItem(`${this.userAccessToken}-accessToken`)
if (token) {
return token
}
const local_token = localStorage.getItem(`${token}accessToken`)
const local_token = localStorage.getItem(`${token}-accessToken`)
if (local_token) {
return local_token
}