fix:修改转移会话问题

feat-im-0607-ch
ch 2 years ago
parent ead3a017e1
commit 3ab876abbe

@ -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 18:54:30 * @LastEditTime: 2022-06-13 21:32:46
* @Description: file content * @Description: file content
*/ */
import '@/utils/poto-req'; import '@/utils/poto-req';
@ -34,6 +34,7 @@ const fromatPotoReq = (traceId, traceType, content) => {
message: res.getMessage(), message: res.getMessage(),
}; };
}; };
class MsbIm { class MsbIm {
defaultOption = { defaultOption = {
ioKey: 'traceId', ioKey: 'traceId',
@ -281,13 +282,12 @@ class MsbIm {
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); newData.push(historyData[hisIndex]);
} else { } else {
item.messageList = []; item.messageList = [];
newData = [...newData, item]; newData = [...newData, item];
} }
}); });
this.setSessionData(newData); this.setSessionData(newData);
return Promise.resolve(result); return Promise.resolve(result);
} }
@ -459,5 +459,11 @@ class MsbIm {
} }
return Promise.resolve(result); return Promise.resolve(result);
} }
close() {
this.socket.close();
this.socket = null;
this.isOpen = false;
this.setSessionData([]);
}
} }
export default MsbIm; export default MsbIm;

@ -300,6 +300,7 @@
reason: res.value, reason: res.value,
}) })
.then((res) => { .then((res) => {
currentSessionId.value = null;
Im.setCurSessionId(null); Im.setCurSessionId(null);
Im.getSessionList(); Im.getSessionList();
}); });

Loading…
Cancel
Save