src/views/securityGuard/sfzJS.js
@@ -55,9 +55,9 @@
    //compatibility for firefox and chrome
    var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
    var pc = new myPeerConnection({
            iceServers: []
        }),
        noop = function() {},
        iceServers: []
    }),
        noop = function () { },
        localIPs = {},
        ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
        key;
@@ -71,19 +71,19 @@
    pc.createDataChannel("");
    // create offer and set local description
    pc.createOffer().then(function(sdp) {
        sdp.sdp.split('\n').forEach(function(line) {
    pc.createOffer().then(function (sdp) {
        sdp.sdp.split('\n').forEach(function (line) {
            if (line.indexOf('candidate') < 0) return;
            line.match(ipRegex).forEach(iterateIP);
        });
        pc.setLocalDescription(sdp, noop, noop);
    }).catch(function(reason) {
    }).catch(function (reason) {
        // An error occurred, so handle the failure to connect
    });
    //sten for candidate events
    pc.onicecandidate = function(ice) {
    pc.onicecandidate = function (ice) {
        if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
        ice.candidate.candidate.match(ipRegex).forEach(iterateIP);
    };
@@ -92,11 +92,11 @@
//连接方法
function CertCtl_connect() {
    var baseURL = "";
    getUserIP(function(ip) {
    getUserIP(function (ip) {
        // alert("Got IP! :" + ip);
        baseURL = ip;
    });
    console.log(baseURL, 666666);
    // console.log(baseURL, 666666);
    var result = "";
    var iParam1 = "1";
    //创建请求 第一个参数是代表以post方式发送;第二个是请求端口和地址;第三个表示是否异步
@@ -105,7 +105,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    //返回值readyState   0: 请求未初始化
    //                1: 服务器连接已建立
    //                2:请求已接收
@@ -129,7 +129,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -144,7 +144,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -179,7 +179,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -195,7 +195,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -213,7 +213,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -251,7 +251,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -292,7 +292,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -312,7 +312,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -355,7 +355,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -372,7 +372,7 @@
    //发送请求
    try {
        CertCtl.xhr.send();
    } catch (e) {}
    } catch (e) { }
    if (CertCtl.xhr.readyState == 4 && CertCtl.xhr.status == 200) {
        result = CertCtl.xhr.responseText;
        CertCtl.xhr.readyState = 1;
@@ -433,7 +433,7 @@
            //result页面回显
            document.getElementById("result").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
//断开连接方法
@@ -451,7 +451,7 @@
            //result页面回显
            document.getElementById("result").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
//获取状态方法
@@ -469,7 +469,7 @@
            //result页面回显
            document.getElementById("result").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
//读卡方法
@@ -538,7 +538,7 @@
            //result页面回显
            document.getElementById("result").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
function readIDCardSN() {
@@ -555,7 +555,7 @@
            //result页面回显
            document.getElementById("result").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
function getSAMID() {
@@ -572,7 +572,7 @@
            //result页面回显
            document.getElementById("result").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
function readM1Card() {
@@ -589,7 +589,7 @@
            //result页面回显
            document.getElementById("ACardResult").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
function writeM1Card() {
@@ -606,7 +606,7 @@
            //result页面回显
            document.getElementById("ACardResult").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
function handleAPDUCMD() {
@@ -623,7 +623,7 @@
            //result页面回显
            document.getElementById("ACardResult").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
/*
@@ -692,7 +692,7 @@
            //result页面回显
            document.getElementById("ACardResult").value = result;
        }
    } catch (e) {}
    } catch (e) { }
}
export default CertCtl;