连接关闭的不能发信息

pull/23/head
taoshihan1991 4 years ago
parent 6baf992be8
commit 72c6705012

@ -12,6 +12,7 @@ new Vue({
visitor:{}, visitor:{},
face:[], face:[],
showKfonline:false, showKfonline:false,
socketClosed:false,
}, },
methods: { methods: {
//初始化websocket //初始化websocket
@ -76,6 +77,7 @@ new Vue({
$(".chatBox").append("<div class=\"chatTime\">"+this.chatTitle+"</div>"); $(".chatBox").append("<div class=\"chatTime\">"+this.chatTitle+"</div>");
this.scrollBottom(); this.scrollBottom();
this.socket.close(); this.socket.close();
this.socketClosed=true;
} }
window.parent.postMessage(redata); window.parent.postMessage(redata);
}, },
@ -89,7 +91,13 @@ new Vue({
}); });
return; return;
} }
if(this.socketClosed){
this.$message({
message: '连接关闭!请重新打开页面',
type: 'warning'
});
return;
}
let _this=this; let _this=this;
let mes = {}; let mes = {};
mes.type = "visitor"; mes.type = "visitor";

Loading…
Cancel
Save