私聊中头像错误展示
This commit is contained in:
@@ -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))
|
||||
// 调用完更新之后,删除这条消息
|
||||
|
||||
@@ -151,14 +151,15 @@ const sentImage = (conversationType, targetId, imageUrl, user, callback) => {
|
||||
})
|
||||
}
|
||||
|
||||
const sentGif = (conversationType, targetId, gifUrl, time, callback) => {
|
||||
const sentGif = (conversationType, targetId, gifUrl, time, user, callback) => {
|
||||
const msg = {
|
||||
conversationType: conversationType,
|
||||
targetId: String(targetId),
|
||||
content: {
|
||||
objectName: 'RC:GIFMsg',
|
||||
local: 'file:///' + plus.io.convertLocalFileSystemURL(gifUrl),
|
||||
duration: time
|
||||
duration: time,
|
||||
userInfo: user
|
||||
}
|
||||
}
|
||||
RongIMLib.sendMediaMessage(msg, {
|
||||
@@ -177,14 +178,15 @@ const sentGif = (conversationType, targetId, gifUrl, time, callback) => {
|
||||
})
|
||||
}
|
||||
|
||||
const sendFile = (conversationType, targetId, fileUrl, time, callback) => {
|
||||
const sendFile = (conversationType, targetId, fileUrl, time, user, callback) => {
|
||||
const msg = {
|
||||
conversationType: conversationType,
|
||||
targetId: String(targetId),
|
||||
content: {
|
||||
objectName: 'RC:FileMsg',
|
||||
local: 'file:///' + plus.io.convertLocalFileSystemURL(fileUrl),
|
||||
duration: time
|
||||
duration: time,
|
||||
userInfo: user
|
||||
}
|
||||
}
|
||||
RongIMLib.sendMediaMessage(msg, {
|
||||
@@ -204,7 +206,7 @@ const sendFile = (conversationType, targetId, fileUrl, time, callback) => {
|
||||
}
|
||||
|
||||
export default {
|
||||
getMessageList,
|
||||
getMessageList,
|
||||
getPendingList,
|
||||
sentText,
|
||||
sentVoice,
|
||||
|
||||
Reference in New Issue
Block a user