From 150f61315ee6da32f4e13d8b3f476cb649608270 Mon Sep 17 00:00:00 2001 From: ch Date: Mon, 13 Jun 2022 22:17:39 +0800 Subject: [PATCH] fix: update im SDK --- plugins/msbIm.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/plugins/msbIm.js b/plugins/msbIm.js index 4825467..a993e27 100644 --- a/plugins/msbIm.js +++ b/plugins/msbIm.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-05-18 14:54:47 * @LastEditors: ch - * @LastEditTime: 2022-06-13 21:56:37 + * @LastEditTime: 2022-06-13 22:17:14 * @Description: file content */ import { CreateUUID, FormatDate, ToAsyncAwait } from "@/plugins/utils"; @@ -33,7 +33,6 @@ const fromatPotoReq = (traceId, traceType, content) => { message: res.getMessage(), }; }; - class MsbIm { defaultOption = { ioKey: 'traceId', @@ -278,21 +277,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); }