diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/project/message/js/wbsUtil.js b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/project/message/js/wbsUtil.js index 846963dd..301cce1b 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/project/message/js/wbsUtil.js +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/project/message/js/wbsUtil.js @@ -7,7 +7,6 @@ var websocketUtil={ websocketUtil._openWebSocket(); //连接发生错误的回调方法 websocket.onerror = function () { - debugger console.log("WebSocket连接发生错误"); websocketUtil._openWebSocket(); //websocketUtil._init(); @@ -18,18 +17,18 @@ var websocketUtil={ websocket.onopen = function () { websocketUtil._getMes(); - } + }; //接收到消息的回调方法 websocket.onmessage = function (event) { debugger websocketUtil._getMes(); - } + }; //连接关闭的回调方法 websocket.onclose = function () { //setMessageInnerHTML("WebSocket连接关闭"); - } + }; //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。 window.onbeforeunload = function () { @@ -38,7 +37,7 @@ var websocketUtil={ }, //发送消息 _send:function(message){ - websocketUtil._openWebSocket() + websocketUtil._openWebSocket(); try { //发送消息 websocket.addEventListener('open',function(){ @@ -82,7 +81,7 @@ var websocketUtil={ }, //获取消息 _getMes:function(){ - var data={"receiverId":userId} + var data={"receiverId":userId}; var url="/message/action/getReceiver"; $.ajax({ type: "POST", @@ -102,7 +101,7 @@ var websocketUtil={ _openMSG:function(data){ var width=400; var height=400; - var title="消息提示" + var title="消息提示"; var content="
你小子有点带
"; for(var i=0;i