南昌市物联网技防平台-前端
shuishen
2021-04-08 a4e06ccd3cd976fbe4eef99e188d42ec9f3ad054
src/page/index/logo.vue
@@ -403,11 +403,9 @@
                  .then((result) => {
                    axios({
                      method: "post",
                      url: `/api/blade-jfpts/rvideo/rVoid`,
                      timeout: 600000,
                      url: `/api/blade-jfpts/rvideo/rVoids`,
                      params: {
                        sourcePath: result.data.data.flv,
                        jid: that.form.id,
                        url: result.data.data.flv,
                      },
                    }).then((resdata) => {});
                  });
@@ -444,7 +442,6 @@
      this.videoConversationReal = false;
      this.oldVideoSatart = false;
    },
    getDate() {
      // 当前时间
      var timestamp = Date.parse(new Date());
@@ -574,6 +571,14 @@
        )
        .then(function () {
          that.dialogTableVisible = false;
          axios({
            method: "post",
            url: `/api/blade-jfpts/rvideo/stop`,
            params: {
              jid: row.id,
            },
          }).then((resdata) => {});
          that.$router.push({
            path: "/policeTracking/track",
@@ -802,6 +807,8 @@
    //启动websocket
    websocketStart() {
      var that = this;
      if (!window.WebSocket) {
        window.WebSocket = window.MozWebSocket;
      }
@@ -817,6 +824,10 @@
        window.socket.onopen = function (event) {};
        window.socket.onclose = function (event) {};
        window.socket.error = function (event) {
          //执行重连
          that.websocketStart();
        };
      } else {
        console.log("WebSocket连接没有建立成功!!");
      }
@@ -836,22 +847,20 @@
          //开启心跳传送
          window.websockPing = setInterval(function () {
            if (window.socket.readyState == WebSocket.OPEN) {
              window.socket.send("ping");
            }else{
            } else {
              console.log("心跳停止,断开重连");
              //断开连接,重连
              window.clearTimeout(window.websockPing);
              //执行重连
              this.websocketStart();
              that.websocketStart();
            }
          }, 10000);
        } else {
          console.log("WebSocket连接没有建立成功!!");
          //执行重连
          this.websocketStart();
          that.websocketStart();
        }
      }, 3000);
    },