fix:update sdk

feature/im-0611-ch
ch 2 years ago
parent 150f61315e
commit 22dab20d79

@ -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 22:17:14 * @LastEditTime: 2022-06-14 11:49:08
* @Description: file content * @Description: file content
*/ */
import { CreateUUID, FormatDate, ToAsyncAwait } from "@/plugins/utils"; import { CreateUUID, FormatDate, ToAsyncAwait } from "@/plugins/utils";
@ -33,6 +33,7 @@ const fromatPotoReq = (traceId, traceType, content) => {
message: res.getMessage(), message: res.getMessage(),
}; };
}; };
class MsbIm { class MsbIm {
defaultOption = { defaultOption = {
ioKey: 'traceId', ioKey: 'traceId',
@ -281,6 +282,11 @@ class MsbIm {
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 hisIndex = historyData.findIndex((i) => i.id === item.id);
if (hisIndex < 0) {
item.messageList = [];
}
// 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) {
@ -302,6 +308,7 @@ class MsbIm {
async getHistoryMsg() { async getHistoryMsg() {
const curSessionIdx = this.sessionData.findIndex((i) => i.id === this.curSessionId); const curSessionIdx = this.sessionData.findIndex((i) => i.id === this.curSessionId);
const curSession = this.sessionData[curSessionIdx]; const curSession = this.sessionData[curSessionIdx];
console.log(curSession, this.curSessionId,'this.curSessionId');
const msgList = curSession.messageList || []; const msgList = curSession.messageList || [];
const par = { const par = {
traceId: CreateUUID(), traceId: CreateUUID(),

Loading…
Cancel
Save