From 4789476b3fe734b4366ce72079330cea32a4997d Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期五, 06 六月 2025 18:04:20 +0800
Subject: [PATCH] 1.评论

---
 store/user.ts |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/store/user.ts b/store/user.ts
index 61a39ea..e9535f7 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'
 
 
@@ -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