From 6af4ca37a5fa72cedaadfc202e56c9729353fe0a Mon Sep 17 00:00:00 2001
From: ZhuDongming <zdm773644075@hotmail.com>
Date: Mon, 22 Jun 2020 17:35:16 +0800
Subject: [PATCH] update

---
 src/main/java/com/moral/webSocketServer/WebSocketServer.java |    5 ++---
 src/main/webapp/view/newmap.jsp                              |   12 +++++++-----
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/moral/webSocketServer/WebSocketServer.java b/src/main/java/com/moral/webSocketServer/WebSocketServer.java
index e019555..33d06c8 100644
--- a/src/main/java/com/moral/webSocketServer/WebSocketServer.java
+++ b/src/main/java/com/moral/webSocketServer/WebSocketServer.java
@@ -82,7 +82,6 @@
                 sendMessage(message);
             }
         }catch (Exception e){
-            e.printStackTrace();
             log.error(e.getMessage());
         }
     }
@@ -127,7 +126,7 @@
                 this.session.getBasicRemote().sendText(message);
             }
         } catch (IOException e) {
-            e.printStackTrace();
+            log.error(e.getMessage());
         }
     }
 
@@ -139,7 +138,7 @@
      */
     @OnError
     public void onError(Session session, Throwable error) {
-        error.printStackTrace();
+        log.error(error.getMessage());
     }
 
 }
diff --git a/src/main/webapp/view/newmap.jsp b/src/main/webapp/view/newmap.jsp
index 98f7c9a..01abedf 100644
--- a/src/main/webapp/view/newmap.jsp
+++ b/src/main/webapp/view/newmap.jsp
@@ -347,10 +347,10 @@
         <div class="charts_btn">
         </div>
     </div>
-   <%-- <div class="search_box">
-        <button id="searchBtn" type="button">������</button>
-        <textarea style="width: 300px;height:400px;" id="searchParam"></textarea>
-    </div>--%>
+    <%-- <div class="search_box">
+         <button id="searchBtn" type="button">������</button>
+         <textarea style="width: 300px;height:400px;" id="searchParam"></textarea>
+     </div>--%>
     <!-- <div id="popup_box">
           <div id="equ_list" class="listview">
           </div>
@@ -366,6 +366,8 @@
 <script>
     //���������������
     (function ($) {
+        var hostAndPort = document.location.host;
+        var hostAddress = hostAndPort.substr(0, hostAndPort.length - 4);
         var moralMap = window.moralMap;
         var params = $.parseJSON($("#mapParams").html());
         moralMap['params'] = params;
@@ -642,7 +644,7 @@
         if (typeof (WebSocket) === "undefined") {
             alert("������������������������WebSocket");
         } else {
-            ws = new WebSocket('ws://47.96.15.25:8080/screen/webSocket/' + orgId + '&' + regionCode);
+            ws = new WebSocket('ws://' + hostAddress + '8080/screen/webSocket/' + orgId + '&' + regionCode);
             ws.onopen = function () {
             };
 

--
Gitblit v1.8.0