diff --git a/src/utils/sock.js b/src/utils/sock.js index e24c698b2..578314493 100644 --- a/src/utils/sock.js +++ b/src/utils/sock.js @@ -42,16 +42,7 @@ StompClient.prototype = { // 注意sockjs会做降级处理,优先处理websockets,若浏览器不支持websockets // 则会降级为xhr_streaming(轮询),继续不支持的时候会降级为xhr-polling this.socket = new SockJS(websocketUrl + getToken()); - var _transportClose = this.socket._transportClose; - const that111 = this; - this.socket._transportClose = function(code, reason) { - console.log(code, reason, '================', this._transport, this._transport.close); - // if (this._transport && this._transport.close) { - // this._transport.close(); - // } - this._transportClose(); - _transportClose.call(this, code, reason); - }; + // 获取 STOMP 子协议的客户端对象 this.clientIns = Stomp.over(this.socket); @@ -177,7 +168,6 @@ StompClient.prototype = { }, disconnect() { - console.log('---------------------'); if (this.clientIns && this.clientIns.connected) { this.clientIns.disconnect(); this.socket.close();