소스 검색

websocket ip还原

WANGJIALIANG 3 년 전
부모
커밋
5d081089c6
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/main/resources/static/js/common/socket-com.js

+ 3 - 3
src/main/resources/static/js/common/socket-com.js

@@ -3,7 +3,7 @@ var prescriptionPrintWebsocket = null;
 var lockReconnect = false; //避免ws重复连接
 var lastPatient = '';
 var number = 0;//重连次数
-var ip = '172.16.32.160:81';
+var ip = '172.16.32.161:8089';
 function openSocket(type) {
 //判断当前浏览器是否支持WebSocket
     try {
@@ -51,14 +51,14 @@ function openSocket(type) {
     prescriptionPrintWebsocket.onclose = function (event) {
         console.log(type+"连接prescriptionPrintSocket连接关闭 code:"+event.code+",原因:"+event.reason+",是否正常关闭:"+event.wasClean);
         if(event.code == '1001' || event.code == '1006'){//1001:终端离开, 可能因为服务端错误 1006:没有发送关闭帧
-            /*number += 1;
+            number += 1;
             if(number > 5){
                 if(ip == '172.16.32.161:8089'){
                     ip = '172.16.32.160:8089'
                 }else{
                     ip = '172.16.32.161:8089'
                 }
-            }*/
+            }
             reconnect(type);
         }
     };