From f3ea52bf97e61f6917ccaab904817d74d9d4860c Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期四, 17 七月 2025 09:55:36 +0800 Subject: [PATCH] init --- store/user.ts | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/store/user.ts b/store/user.ts index 57b723e..bfca100 100644 --- a/store/user.ts +++ b/store/user.ts @@ -1,9 +1,9 @@ // stores/user.ts import { defineStore } from 'pinia' import { ref } from 'vue' -import http from '@/plugins/http.js' // 请替换成你实际的 http 封装路径 -import storage from '@/plugins/storage' // 同样替换为你的封装路径 -import message from '@/plugins/message' // 你使用的消息组件封装 +import http from '@/plugins/http.js' +import storage from '@/plugins/storage' +import message from '@/plugins/message' import { WechatLoginData } from '@/types/index' @@ -86,7 +86,12 @@ // 如果你有持久化,这里也同步一下 // storage.setItem('userInfo', userInfo.value) } - + function $reset() { + hasLogin.value = false + isBind.value = false + userInfo.value = null + address.value = null + } return { hasLogin, @@ -97,5 +102,6 @@ getCurrentInfo, initLoginState, updateAddress, + $reset, } }) -- Gitblit v1.9.3