删除sock测试和日志

This commit is contained in:
fan 2020-04-17 09:23:11 +08:00
parent 9d37ecd035
commit 9e048bb56e

View File

@ -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();