diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 603bca1..9523562 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -418,14 +418,15 @@ export default { const openId = uni.getStorageSync('openid') || ''; const infoRes = await gatewayGet('/api/v1/user/info', { open_id: openId }); const infoData = (infoRes.data || {}).data || {}; - if (infoData.user_id) { + const userInfo = infoData.user_info || {}; + if (userInfo.user_id) { const existing = getCachedUserInfo() || {}; uni.setStorageSync('user_info', { ...existing, - user_id: infoData.user_id, - nickname: infoData.nickname || existing.nickname || '', - avatar: infoData.avatar || existing.avatar || '', - phone: infoData.phone || existing.phone || '', + user_id: userInfo.user_id, + nickname: userInfo.nickname || existing.nickname || '', + avatar: userInfo.avatar || existing.avatar || '', + phone: userInfo.phone || existing.phone || '', }); this.loadUserInfo(); }