|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-05-18 14:54:47
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-06-13 21:55:21
|
|
|
|
|
* @LastEditTime: 2022-06-13 22:18:23
|
|
|
|
|
* @Description: file content
|
|
|
|
|
*/
|
|
|
|
|
import { CreateUUID, FormatDate, ToAsyncAwait } from "@/common/utils";
|
|
|
|
@ -278,21 +278,21 @@ class MsbIm {
|
|
|
|
|
const { content } = result;
|
|
|
|
|
// let newData = [];
|
|
|
|
|
|
|
|
|
|
// content.sessionVOS.forEach((item) => {
|
|
|
|
|
// if (item.lastMessage) {
|
|
|
|
|
// item.lastMessage.payload = JSON.parse(item.lastMessage.payload || {});
|
|
|
|
|
// }
|
|
|
|
|
// let historyData = this.sessionData;
|
|
|
|
|
// let hisIndex = historyData.findIndex((i) => i.id === item.id);
|
|
|
|
|
// if (hisIndex >= 0) {
|
|
|
|
|
// historyData[hisIndex].lastMessage = item.lastMessage;
|
|
|
|
|
// historyData[hisIndex].unreadCount++;
|
|
|
|
|
// newData.push(historyData[hisIndex]);
|
|
|
|
|
// } else {
|
|
|
|
|
// item.messageList = [];
|
|
|
|
|
// newData = [...newData, item];
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
content.sessionVOS.forEach((item) => {
|
|
|
|
|
if (item.lastMessage) {
|
|
|
|
|
item.lastMessage.payload = JSON.parse(item.lastMessage.payload || {});
|
|
|
|
|
}
|
|
|
|
|
// let historyData = this.sessionData;
|
|
|
|
|
// let hisIndex = historyData.findIndex((i) => i.id === item.id);
|
|
|
|
|
// if (hisIndex >= 0) {
|
|
|
|
|
// historyData[hisIndex].lastMessage = item.lastMessage;
|
|
|
|
|
// historyData[hisIndex].unreadCount++;
|
|
|
|
|
// newData.push(historyData[hisIndex]);
|
|
|
|
|
// } else {
|
|
|
|
|
// item.messageList = [];
|
|
|
|
|
// newData = [...newData, item];
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
this.setSessionData(content.sessionVOS);
|
|
|
|
|
return Promise.resolve(result);
|
|
|
|
|
}
|
|
|
|
|