diff --git a/plugins/chat.js b/plugins/chat.js index 5cc9c67..8197188 100644 --- a/plugins/chat.js +++ b/plugins/chat.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-06-12 14:04:56 * @LastEditors: ch - * @LastEditTime: 2022-06-13 11:48:41 + * @LastEditTime: 2022-06-13 20:27:34 * @Description: file content */ @@ -39,7 +39,6 @@ export default ({store }) => { let data = Im.sessionData.find(i => { return (i.type === 4 && (typeof i.payload === 'string' ? JSON.parse(i.payload).type === 'system' : false)); }) || {} - console.log(data,'---'); let msgCount = data.unreadCount || 0; store.commit('setSocketMsgData', JSON.parse(JSON.stringify(data))); store.commit('setUnreadCount', msgCount); diff --git a/plugins/msbIm.js b/plugins/msbIm.js index 442f030..3fe0ad2 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 19:52:36 + * @LastEditTime: 2022-06-13 21:04:11 * @Description: file content */ import { CreateUUID, FormatDate, ToAsyncAwait } from "@/plugins/utils"; @@ -33,6 +33,7 @@ const fromatPotoReq = (traceId, traceType, content) => { message: res.getMessage(), }; }; + class MsbIm { defaultOption = { ioKey: 'traceId', @@ -458,5 +459,11 @@ class MsbIm { } return Promise.resolve(result); } + close() { + this.socket.close(); + this.socket = null; + this.isOpen = false; + this.setSessionData([]); + } } export default MsbIm; \ No newline at end of file