1.退出登录清除AI聊天
This commit is contained in:
@@ -23,3 +23,28 @@ export function getTokenKeySessionStorage() {
|
||||
export function removeToken() {
|
||||
return Cookies.remove(TokenKey)
|
||||
}
|
||||
|
||||
// 清理sessionStorage中的token
|
||||
export function removeTokenFromSessionStorage() {
|
||||
sessionStorage.removeItem(TokenKey)
|
||||
}
|
||||
|
||||
// 清理AI聊天相关的localStorage数据
|
||||
export function clearAIChatCache() {
|
||||
localStorage.removeItem('conversation_id')
|
||||
// 可以根据需要添加其他AI聊天相关的缓存清理
|
||||
}
|
||||
|
||||
// 清理所有用户相关的缓存数据
|
||||
export function clearAllUserCache() {
|
||||
// 清理token相关
|
||||
removeToken()
|
||||
removeTokenFromSessionStorage()
|
||||
|
||||
// 清理AI聊天缓存
|
||||
clearAIChatCache()
|
||||
|
||||
// 清理其他用户相关的localStorage数据
|
||||
localStorage.removeItem('userId')
|
||||
localStorage.removeItem('userName')
|
||||
}
|
||||
|
Reference in New Issue
Block a user