修复bug

This commit is contained in:
2026-06-05 17:50:17 +08:00
parent 5379380d33
commit f5f6885318

View File

@@ -145,6 +145,8 @@
opacity: 0, opacity: 0,
extraIcons: [] // 右侧额外图标 extraIcons: [] // 右侧额外图标
}, },
// 用户信息(响应式)
userInfo: uni.getStorageSync('userInfo') || {}
} }
}, },
@@ -163,9 +165,9 @@
staticHost() { staticHost() {
return this.$config.staticUrl return this.$config.staticUrl
}, },
user() { user() {
return uni.getStorageSync('userInfo') || {} return this.userInfo
} }
}, },
@@ -210,17 +212,20 @@
}).then(obj => { }).then(obj => {
if(obj.flag){ if(obj.flag){
console.log("更新缓存中用户信息") console.log("更新缓存中用户信息")
uni.setStorageSync('userInfo', { const newUserInfo = {
userType: obj.data.userType, userType: obj.data.userType,
oaAuth: obj.data.oaAuth, oaAuth: obj.data.oaAuth,
cusNo: obj.data.cusNo, cusNo: obj.data.cusNo,
userName: obj.data.userName, userName: obj.data.userName,
openId: obj.data.openId, openId: obj.data.openId,
subscribe: obj.data.subscribeMsg subscribe: obj.data.subscribeMsg
}) }
uni.setStorageSync('userInfo', newUserInfo)
// 更新响应式数据
this.userInfo = newUserInfo
} }
}); });
}, },
logout() { logout() {
this.$u.vuex('vuex_token', ''); this.$u.vuex('vuex_token', '');