|
@@ -212,9 +212,7 @@ export default {
|
|
|
|
|
|
// 接收到消息的回调方法
|
|
|
this.websocket.onmessage = function (event) {
|
|
|
- if (typeof event.data == 'string') {
|
|
|
- console.log(event.data);
|
|
|
- } else {
|
|
|
+ try {
|
|
|
let msg = JSON.parse(event.data);
|
|
|
let i = msg.typeId - 1;
|
|
|
if (msg.userId) {
|
|
@@ -237,7 +235,7 @@ export default {
|
|
|
that.getMessageList();
|
|
|
that.getUnreadNumber();
|
|
|
}
|
|
|
- }
|
|
|
+ } catch (e) {}
|
|
|
};
|
|
|
|
|
|
// 连接关闭的回调方法
|