From 72e038e5e3eeaeb447e89adae78230fafb5a114c Mon Sep 17 00:00:00 2001 From: chenrui <1950717904@qq.com> Date: Fri, 6 Dec 2024 12:50:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E6=B3=95=E9=A2=84=E8=AD=A6=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/project/message/js/wbsUtil.js | 21 ++-- .../LawEnforcementWarningList.html | 113 ++++++++++++++---- .../registrationDetail.html | 38 ++---- .../EnforcementRegistrationController.java | 10 +- .../LawEnforcementWarningListMapper.xml | 2 +- 5 files changed, 111 insertions(+), 73 deletions(-) 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