1
wwl
2025-02-13 c699c544034a0e57e9881fc99930eddfa75c9f8c
1
1个文件已修改
10 ■■■■■ 已修改文件
src/views/system/tijian/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,10 +1860,11 @@
              //接收到消息的回调方法
              websocket.onmessage = (event) => {
                var resultObj = eval("(" + event.data + ")");
                var resultObj = eval("(" + event.data + ")");  // 注意:eval存在安全隐患,建议用JSON.parse
                this.readCardWebSocket(resultObj);
                websocket.close();
              };
              websocket.onclose = function () {
              websocket.onclose = () => {
                alert("读卡器连接关闭");
              };
            } else if (res.msg == "Y") {
@@ -1883,8 +1885,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" ? "女" : "男";