im聊天发送中文问题

master
2023-02-09 15:59:08 +08:00
parent 092873592d
commit cc31b6232f
1 changed files with 13 additions and 8 deletions

View File

@ -222,17 +222,22 @@ class WsSocket {
*/ */
onMessage (evt) { onMessage (evt) {
let result = this.onParse(evt); let result = this.onParse(evt);
console.log("接收消息", result, "color:red"); if (this.onParse(evt).text.includes('goodsName') || this.onParse(evt).text.includes('groupName')) {
// 判断消息事件是否被绑定 let params = {
// event_talk; ...this.onParse(evt),
let params = { text: JSON.parse(this.onParse(evt).text)
...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心跳检测 * WebSocket心跳检测
*/ */