qx
qx
2025-02-14 32472073d74347c90928f3eaea52fb8c5fda9fdc
src/views/system/tijian/index.vue
@@ -1820,6 +1820,7 @@
        let configKey = "getInfoFromSqlData";
        getconfigKey(configKey).then((res) => {
          if (res.code == 200) {
            console.log(res.msg, 'res.msg');
            if (res.msg == "N") {
              var websocket = null;
              var url = this.valueUrl;
@@ -1859,12 +1860,11 @@
              //接收到消息的回调方法
              websocket.onmessage = (event) => {
                var resultObj = eval("(" + event.data + ")");
                var resultObj = eval("(" + event.data + ")");  // 注意:eval存在安全隐患,建议用JSON.parse
                this.readCardWebSocket(resultObj);
              };
              websocket.onclose = function () {
                alert("读卡器连接关闭");
              };
            } else if (res.msg == "Y") {
              /* this.$refs.aaa.open = true;
              this.$refs.aaa.getAllList();
@@ -1883,8 +1883,8 @@
    // 最新使用webSocket通信
    readCardWebSocket(resultObj) {
      let _this = this;
      if (resultObj.code === 200 && resultObj.data.name != null) {
      console.log(resultObj, 'resultObj');
      if (resultObj.code === 200 && resultObj.data.name && resultObj.data.name != null) {
        //回显相关数据
        _this.form.cusName = resultObj.data.name;
        _this.form.cusSex = resultObj.data.sex == "0" ? "女" : "男";
@@ -2028,9 +2028,9 @@
            }
          }
        };
        websocket.onclose = function () {
          alert("读卡器连接关闭");
        };
        // websocket.onclose = function () {
        //   alert("读卡器连接关闭");
        // };
        websocket.onmessage = function (event) {
          var resultObj = JSON.parse(event.data);
          _this.form.cusName = resultObj.data.name;
@@ -2122,9 +2122,9 @@
            }
          }
        };
        websocket.onclose = function () {
          alert("读卡器连接关闭");
        };
        // websocket.onclose = function () {
        //   alert("读卡器连接关闭");
        // };
        websocket.onmessage = function (event) {
          var resultObj = JSON.parse(event.data);
          _this.form.cusName = resultObj.data.name;