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) {
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心跳检测
*/