|
|
@ -2,7 +2,7 @@
|
|
|
|
* @Author: ch
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2022-05-18 14:54:47
|
|
|
|
* @Date: 2022-05-18 14:54:47
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-06-13 21:40:12
|
|
|
|
* @LastEditTime: 2022-06-13 21:53:01
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
import '@/utils/poto-req';
|
|
|
|
import '@/utils/poto-req';
|
|
|
@ -277,24 +277,24 @@ class MsbIm {
|
|
|
|
return Promise.reject(error);
|
|
|
|
return Promise.reject(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const { content } = result;
|
|
|
|
const { content } = result;
|
|
|
|
let newData = [];
|
|
|
|
// let newData = [];
|
|
|
|
|
|
|
|
|
|
|
|
content.sessionVOS.forEach((item) => {
|
|
|
|
// content.sessionVOS.forEach((item) => {
|
|
|
|
if (item.lastMessage) {
|
|
|
|
// if (item.lastMessage) {
|
|
|
|
item.lastMessage.payload = JSON.parse(item.lastMessage.payload || {});
|
|
|
|
// item.lastMessage.payload = JSON.parse(item.lastMessage.payload || {});
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
let historyData = this.sessionData;
|
|
|
|
// let historyData = this.sessionData;
|
|
|
|
let hisIndex = historyData.findIndex((i) => i.id === item.id);
|
|
|
|
// let hisIndex = historyData.findIndex((i) => i.id === item.id);
|
|
|
|
if (hisIndex >= 0) {
|
|
|
|
// if (hisIndex >= 0) {
|
|
|
|
historyData[hisIndex].lastMessage = item.lastMessage;
|
|
|
|
// historyData[hisIndex].lastMessage = item.lastMessage;
|
|
|
|
historyData[hisIndex].unreadCount++;
|
|
|
|
// historyData[hisIndex].unreadCount++;
|
|
|
|
newData.push(historyData[hisIndex]);
|
|
|
|
// newData.push(historyData[hisIndex]);
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
item.messageList = [];
|
|
|
|
// item.messageList = [];
|
|
|
|
newData = [...newData, item];
|
|
|
|
// newData = [...newData, item];
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
this.setSessionData(newData);
|
|
|
|
this.setSessionData(content.sessionVOS);
|
|
|
|
return Promise.resolve(result);
|
|
|
|
return Promise.resolve(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|