私聊中头像错误展示

This commit is contained in:
2022-02-16 16:58:45 +08:00
parent fe9b79a18d
commit 255a727d32
8 changed files with 43 additions and 38 deletions

View File

@@ -71,14 +71,14 @@ const connect = (token, userInfo, callback) => {
})
})
},
fail: () => {
fail: () => {
// 程序是首次运行,初始化加载好友和群组信息
Promise.all([getFriends(), getMyGroups()]).then(result => {
Promise.all([getFriends(), getMyGroups()]).then(result => {
result.map(contacts => {
contacts.map(item => {
store.dispatch('initContact', item)
})
})
})
uni.setStorageSync(FK, userInfo.targetId)
})
}
@@ -141,16 +141,16 @@ const addListeners = () => {
}).catch(err => {
console.log('ERR', err)
})
}
if (!store.getters.contactIsExist(message.senderUserId)) {
getUserInfo(message.senderUserId).then(res => {
store.dispatch('initContact', res)
}).catch(err => {
console.log('ERR', err)
})
}
if (!store.getters.contactIsExist(message.senderUserId)) {
getUserInfo(message.senderUserId).then(res => {
store.dispatch('initContact', res)
}).catch(err => {
console.log('ERR', err)
})
}
newMessage(message)
} else if (message.objectName === RongIMLib.ObjectName.ProfileNotification) {
} else if (message.objectName === RongIMLib.ObjectName.ProfileNotification) {
// 更新会话信息
store.dispatch('updateContact', JSON.parse(message.content.data))
// 调用完更新之后,删除这条消息