南昌市物联网技防平台-前端
zengh
2021-03-24 2c4d726e2f3af93a36d1685a9afdfd2c62a9f544
src/page/index/logo.vue
@@ -370,14 +370,14 @@
        }
        if (window.WebSocket) {
          that.socket = new WebSocket("ws://36.134.81.48:9034/websocket");
          that.socket.onmessage = function (event) {
          window.socket = new WebSocket("ws://36.134.81.48:9034/websocket");
          window.socket.onmessage = function (event) {
          };
          that.socket.onopen = function (event) {
          window.socket.onopen = function (event) {
          };
          that.socket.onclose = function (event) {
          window.socket.onclose = function (event) {
          };
        } else {
          console.log("您的浏览器不支持WebSocket");
@@ -387,12 +387,12 @@
          if(!window.WebSocket){
            return;
          }
          if(that.socket.readyState == WebSocket.OPEN){
            that.socket.send(that.userId);
          if(window.socket.readyState == WebSocket.OPEN){
            window.socket.send(that.userId);
          }else{
            console.log("WebSocket连接没有建立成功!!");
          }
        }, 4000);
        }, 2000);
        axios({