usWebCMPXMLHttp.js 1.5 KB

1
  1. (function(){function g(b){b=b.usWebCMPXMLHttp=b.usWebCMPXMLHttp||{};var a=null;b.uniSignE2ERequest=function(h,b,d,f,e){"undefined"===typeof e&&(e="application/pkixcmp");if(null==a)if(window.XMLHttpRequest)a=new XMLHttpRequest;else if(window.ActiveXObject)try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(l){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(m){a=null}}"POST"==h?(a.open(h,d,!0),a.setRequestHeader("Content-Type",e),a.setRequestHeader("Cache-Control","no-cache, must-revalidate"),a.setRequestHeader("Pragma","no-cache"),a.withCredentials=!0,a.onreadystatechange=function(){4==a.readyState&&200==a.status?f(a.responseText):4==a.readyState&&400<=a.status&&510>a.status?f(a):4==a.readyState&&510<=a.status&&600>a.status&&f(a)},"application/pkixcmp"==e?a.send(encodeURIComponent(b)):a.send(b)):(alert("error"),a=null)};b.trim_script=function(a){return a.replace(/^\s+/g,"").replace(/\s+$/g,"")};b.uniSignE2ERespons=function(a){if(null==a)return alert("respone data is null"),null;a=trim_script(a);return"nok"==a.split("$")[0]?(alert(a),null):a}}var k=[],c=null;"function"!==typeof define&&("object"===typeof module&&module.exports?c=function(b,a){a(require,module)}:(crosscert=window.crosscert=window.crosscert||{},g(crosscert)));(c||"function"===typeof define)&&(c||define)(["require","module"].concat(k),function(b,a){a.exports=function(a){var c=k.map(function(a){return b(a)}).concat(g);a=a||{};a.defined=a.defined||{};if(a.defined.usWebCMPXMLHttp)return a.usWebCMPXMLHttp;a.defined.usWebCMPXMLHttp=!0;for(var d=0;d<c.length;++d)c[d](a);return a.usWebCMPXMLHttp}})})();