Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 533170f0a9 |
@@ -418,14 +418,15 @@ export default {
|
|||||||
const openId = uni.getStorageSync('openid') || '';
|
const openId = uni.getStorageSync('openid') || '';
|
||||||
const infoRes = await gatewayGet('/api/v1/user/info', { open_id: openId });
|
const infoRes = await gatewayGet('/api/v1/user/info', { open_id: openId });
|
||||||
const infoData = (infoRes.data || {}).data || {};
|
const infoData = (infoRes.data || {}).data || {};
|
||||||
if (infoData.user_id) {
|
const userInfo = infoData.user_info || {};
|
||||||
|
if (userInfo.user_id) {
|
||||||
const existing = getCachedUserInfo() || {};
|
const existing = getCachedUserInfo() || {};
|
||||||
uni.setStorageSync('user_info', {
|
uni.setStorageSync('user_info', {
|
||||||
...existing,
|
...existing,
|
||||||
user_id: infoData.user_id,
|
user_id: userInfo.user_id,
|
||||||
nickname: infoData.nickname || existing.nickname || '',
|
nickname: userInfo.nickname || existing.nickname || '',
|
||||||
avatar: infoData.avatar || existing.avatar || '',
|
avatar: userInfo.avatar || existing.avatar || '',
|
||||||
phone: infoData.phone || existing.phone || '',
|
phone: userInfo.phone || existing.phone || '',
|
||||||
});
|
});
|
||||||
this.loadUserInfo();
|
this.loadUserInfo();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user