From 6ef1b14f735acdc3ff77a50da1bb09a5bb983dcc Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期三, 28 五月 2025 17:37:06 +0800
Subject: [PATCH] location,userinfo
---
store/user.ts | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/store/user.ts b/store/user.ts
index 61a39ea..57b723e 100644
--- a/store/user.ts
+++ b/store/user.ts
@@ -11,6 +11,7 @@
const hasLogin = ref(false)
const isBind = ref(false)
const userInfo = ref<any>(null)
+ const address = ref<any>(null)
async function getCurrentInfo() {
const currentInfo = await http.request('get', '/api/current/user', {})
@@ -75,14 +76,26 @@
hasLogin.value = false
}
}
+
+
+ function updateAddress(addressParam:any) {
+
+ // 合并新信息到 userInfo 中
+ console.log("addressParam",addressParam)
+ address.value = addressParam
+ // 如果你有持久化,这里也同步一下
+ // storage.setItem('userInfo', userInfo.value)
+ }
return {
hasLogin,
isBind,
userInfo,
+ address,
loginwx,
getCurrentInfo,
initLoginState,
+ updateAddress,
}
})
--
Gitblit v1.9.3