优化用户注销功能及token处理逻辑

This commit is contained in:
wangqiao
2025-09-14 17:02:57 +08:00
parent b1174fc1e3
commit 9c62a6a198

View File

@ -28,6 +28,8 @@ export default defineStore('useUserStore', {
this.userName = userName this.userName = userName
}, },
logout() { logout() {
const token = useCookie<string | undefined>('token')
token.value = ''
refreshToken.removeToken() refreshToken.removeToken()
localStorage.removeItem('tuxixi-store') localStorage.removeItem('tuxixi-store')
if (self === top) { if (self === top) {