|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-05-18 14:54:47
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-06-14 10:52:01
|
|
|
|
|
* @LastEditTime: 2022-06-14 17:24:14
|
|
|
|
|
* @Description: file content
|
|
|
|
|
*/
|
|
|
|
|
import { CreateUUID, FormatDate, ToAsyncAwait } from "@/common/utils";
|
|
|
|
@ -34,6 +34,7 @@ const fromatPotoReq = (traceId, traceType, content) => {
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MsbIm {
|
|
|
|
|
defaultOption = {
|
|
|
|
|
ioKey: 'traceId',
|
|
|
|
@ -200,7 +201,7 @@ class MsbIm {
|
|
|
|
|
...historyData,
|
|
|
|
|
{
|
|
|
|
|
fromAvatar: ctx.session.fromAvatar,
|
|
|
|
|
fromId: ctx.fromId,
|
|
|
|
|
fromId: ctx.session.fromId,
|
|
|
|
|
fromNickname: ctx.session.fromNickname,
|
|
|
|
|
id: ctx.sessionId,
|
|
|
|
|
lastMessage: ctx,
|
|
|
|
@ -308,7 +309,7 @@ class MsbIm {
|
|
|
|
|
async getHistoryMsg() {
|
|
|
|
|
const curSessionIdx = this.sessionData.findIndex((i) => i.id === this.curSessionId);
|
|
|
|
|
const curSession = this.sessionData[curSessionIdx];
|
|
|
|
|
console.log(curSession, this.curSessionId,'this.curSessionId');
|
|
|
|
|
console.log(curSession, this.curSessionId, 'this.curSessionId');
|
|
|
|
|
const msgList = curSession.messageList || [];
|
|
|
|
|
const par = {
|
|
|
|
|
traceId: CreateUUID(),
|
|
|
|
@ -381,6 +382,7 @@ class MsbIm {
|
|
|
|
|
msgCtx.payload = JSON.parse(msgCtx.payload);
|
|
|
|
|
}
|
|
|
|
|
// 点发送,立即把消息加入消息列表,标记为发送中状态
|
|
|
|
|
curSession.lastMessage = msgCtx;
|
|
|
|
|
curSession.messageList.push(msgCtx);
|
|
|
|
|
this.setSessionData(this.sessionData);
|
|
|
|
|
|
|
|
|
@ -399,6 +401,7 @@ class MsbIm {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let newData = [...this.sessionData];
|
|
|
|
|
curSession.lastMessage = msgCtx;
|
|
|
|
|
newData[index] = curSession;
|
|
|
|
|
this.setSessionData(newData);
|
|
|
|
|
if (error) {
|
|
|
|
|