fix(用户模块): 修正清理存储逻辑以正确删除cookie和localStorage项
This commit is contained in:
parent
99550cbc37
commit
cbc504cc0b
|
|
@ -128,9 +128,12 @@ export const useUserStore = defineStore('user', () => {
|
||||||
/* 清理数据 */
|
/* 清理数据 */
|
||||||
const ClearStorage = async () => {
|
const ClearStorage = async () => {
|
||||||
token.value = ''
|
token.value = ''
|
||||||
xToken.value = ''
|
// 使用remove方法正确删除cookie
|
||||||
|
xToken.remove()
|
||||||
sessionStorage.clear()
|
sessionStorage.clear()
|
||||||
|
// 清理所有相关的localStorage项
|
||||||
localStorage.removeItem('originSetting')
|
localStorage.removeItem('originSetting')
|
||||||
|
localStorage.removeItem('token')
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue