From cc31b6232fa5391989b0c90531a2a22e14af60ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B?= <994041296@163.com> Date: Thu, 9 Feb 2023 15:59:08 +0800 Subject: [PATCH] =?UTF-8?q?im=E8=81=8A=E5=A4=A9=E5=8F=91=E9=80=81=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im/src/plugins/ws-socket.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/im/src/plugins/ws-socket.js b/im/src/plugins/ws-socket.js index e7516700..69a3ac8b 100644 --- a/im/src/plugins/ws-socket.js +++ b/im/src/plugins/ws-socket.js @@ -222,17 +222,22 @@ class WsSocket { */ onMessage (evt) { let result = this.onParse(evt); - console.log("接收消息", result, "color:red"); - // 判断消息事件是否被绑定 - // event_talk; - let params = { - ...this.onParse(evt), - text: JSON.parse(this.onParse(evt).text) + if (this.onParse(evt).text.includes('goodsName') || this.onParse(evt).text.includes('groupName')) { + let params = { + ...this.onParse(evt), + text: JSON.parse(this.onParse(evt).text) + } + this.onCallBacks["event_talk"](params); + } else { + let params = { + ...this.onParse(evt), + text: this.onParse(evt).text + } + this.onCallBacks["event_talk"](params); } // 指定推送消息 - this.onCallBacks["event_talk"](params); - } + } /** * WebSocket心跳检测 */