|
@@ -2,8 +2,7 @@
|
|
|
var prescriptionPrintWebsocket = null;
|
|
|
var lockReconnect = false; //避免ws重复连接
|
|
|
var lastPatient = '';
|
|
|
-var number = 0;//重连次数
|
|
|
-var ip = '172.16.32.161:8089';
|
|
|
+var ip = 'webhis.thyy.cn:81';
|
|
|
function openSocket(type) {
|
|
|
//判断当前浏览器是否支持WebSocket
|
|
|
try {
|
|
@@ -51,14 +50,6 @@ 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;
|
|
|
- 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);
|
|
|
}
|
|
|
};
|