提交IE下活体检测代码
This commit is contained in:
@ -4,10 +4,11 @@
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery-webcam-master</title>
|
||||
<!-- <link href="cs.css" rel="stylesheet" type="text/css"> -->
|
||||
<script src="jquery.js"></script>
|
||||
<script src="jquery.webcam.min.js"></script>
|
||||
<script src="jsrsasign-latest-all-min.js"></script>
|
||||
<script src="living.min.js"></script>
|
||||
<script type="text/javascript" src="jquery-3.6.1.min.js"></script>
|
||||
<script type="text/javascript" src="jquery.webcam.min.js"></script>
|
||||
<script type="text/javascript" src="jsrsasign-latest-all-min.js"></script>
|
||||
<script type="text/javascript" src="moment.js"></script>
|
||||
<script type="text/javascript" src="living-jq.min.js"></script>
|
||||
<!-- <script src="excanvas.js"></script> -->
|
||||
</head>
|
||||
<body>
|
||||
@ -17,15 +18,9 @@
|
||||
<script type="text/javascript">
|
||||
var pos = 0, ctx = null, saveCB,w = 380,h= 200, image = new Array();
|
||||
var lv = null;
|
||||
var action = 1,timer = 1000;
|
||||
var liveDetectPhoto = null;
|
||||
var canvas = document.createElement("canvas");//创建画布指定宽度和高度
|
||||
canvas.setAttribute('width', 320);
|
||||
canvas.setAttribute('height', 240);
|
||||
document.body.appendChild(canvas);
|
||||
// canvas = window.G_vmlCanvasManager.initElement(canvas);
|
||||
ctx = canvas.getContext("2d");//设置画布为2d,未来可能支持3d
|
||||
image = ctx.getImageData(0, 0, 320, 240);//截图320*240,即整个画布作为有效区(cutx?)
|
||||
var liveDetectPhotoUrl = null;
|
||||
var canvas = null;
|
||||
$(document).ready(function() {
|
||||
$("#webcam").webcam({
|
||||
width: w,
|
||||
@ -50,10 +45,10 @@
|
||||
//当绘制320*240像素的图片时发给后端php
|
||||
if (pos == 4 * 320 * 240) {
|
||||
//把图像放到画布上,输出为png格式
|
||||
ctx.putImageData(img, 0, 0);
|
||||
liveDetectPhoto = base64ToBlob(canvas.toDataURL("image/png"));
|
||||
//window.parent.postMessage({"image": canvas.toDataURL("image/png")}, '*');
|
||||
image = new Array();
|
||||
ctx.putImageData(img, 0, 0);
|
||||
//liveDetectPhotoUrl = canvas.toDataURL("image/png");
|
||||
liveDetectPhoto = base64ToBlob(canvas.toDataURL("image/png"));
|
||||
//window.parent.postMessage({"image": liveDetectPhoto}, '*');
|
||||
pos = 0;
|
||||
}
|
||||
// image.push(data);
|
||||
@ -66,6 +61,13 @@
|
||||
// }
|
||||
},
|
||||
onCapture: function(data) {
|
||||
canvas = document.createElement("canvas");//创建画布指定宽度和高度
|
||||
canvas.setAttribute('width', 320);
|
||||
canvas.setAttribute('height', 240);
|
||||
// document.body.appendChild(canvas);
|
||||
// canvas = window.G_vmlCanvasManager.initElement(canvas);
|
||||
ctx = canvas.getContext("2d");//设置画布为2d,未来可能支持3d
|
||||
image = ctx.getImageData(0, 0, 320, 240);//截图320*240,即整个画布作为有效区(cutx?)
|
||||
webcam.save();
|
||||
// Show a flash for example
|
||||
},
|
||||
@ -90,9 +92,8 @@
|
||||
if(event.data == 'releaseCamera'){
|
||||
location.reload();
|
||||
}else if(event.data = 'capture'){
|
||||
// liveDetectStart();
|
||||
webcam.capture();
|
||||
console.log(1,liveDetectPhoto);
|
||||
liveDetectStart();
|
||||
//webcam.capture();
|
||||
}
|
||||
//$('#base64image').attr('src', 'data:image/jpg;base64,' + event.data.data);
|
||||
};
|
||||
@ -125,35 +126,36 @@
|
||||
liveDetectStop();
|
||||
let _lv = new Living(null, {
|
||||
timer: 10000,
|
||||
rate: 1000,
|
||||
action : [1,3,2],
|
||||
token: setLiveDetectToken(),
|
||||
proxy:'/living/api',
|
||||
getFacePicture:function(){
|
||||
webcam.capture();
|
||||
return liveDetectPhoto;
|
||||
return {file:liveDetectPhoto};
|
||||
},
|
||||
//开始活体检测,此时token已鉴权成功
|
||||
onDetectStart:function(){
|
||||
//setSubmitLoading(true);
|
||||
},
|
||||
//每轮检测开始
|
||||
onDetectActionStart:function(action){
|
||||
action = action
|
||||
},
|
||||
//每轮检测计时
|
||||
onDetectActionProgress:function(action,timer){
|
||||
timer = timer;
|
||||
window.parent.postMessage({"actionAndTimer": {action:action,timer:timer}}, 'detectStatus');
|
||||
var actionAndTimer = {
|
||||
arg1: action,
|
||||
arg2: timer
|
||||
};
|
||||
//必须传递字符串
|
||||
window.parent.postMessage({"actionAndTimer": actionAndTimer}, '*');
|
||||
},
|
||||
//每轮检测结束
|
||||
onDetectActionFinish:function(action,data){
|
||||
// this.clearCanvas()
|
||||
timer = 10000;
|
||||
console.log(data)
|
||||
},
|
||||
//活体检测完成
|
||||
onDetectFinish:function(data){
|
||||
window.parent.postMessage({"detectResult": data}, 'detectFinish');
|
||||
window.parent.postMessage({"detectResult": data}, '*');
|
||||
}
|
||||
});
|
||||
//开始检测
|
||||
@ -183,5 +185,6 @@
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
2
public/faceLoginIE/jquery-3.6.1.min.js
vendored
Normal file
2
public/faceLoginIE/jquery-3.6.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10881
public/faceLoginIE/jquery.js
vendored
10881
public/faceLoginIE/jquery.js
vendored
File diff suppressed because it is too large
Load Diff
92
public/faceLoginIE/jsrsasign-latest-all-min.js
vendored
92
public/faceLoginIE/jsrsasign-latest-all-min.js
vendored
@ -2,28 +2,28 @@
|
||||
* jsrsasign(all) 10.5.13 (2022-03-18) (c) 2010-2021 Kenji Urushima | kjur.github.io/jsrsasign/license
|
||||
*/
|
||||
|
||||
/*! CryptoJS v3.1.2 core-fix.js
|
||||
* code.google.com/p/crypto-js
|
||||
/*! CryptoJS v3.1.2 core-fix.livingJS
|
||||
* code.google.com/p/crypto-livingJS
|
||||
* (c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
* code.google.com/p/crypto-js/wiki/License
|
||||
* THIS IS FIX of 'core.js' to fix Hmac issue.
|
||||
* code.google.com/p/crypto-livingJS/wiki/License
|
||||
* THIS IS FIX of 'core.livingJS' to fix Hmac issue.
|
||||
* https://code.google.com/p/crypto-js/issues/detail?id=84
|
||||
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
|
||||
*/
|
||||
var CryptoJS=CryptoJS||(function(e,g){var a={};var b=a.lib={};var j=b.Base=(function(){function n(){}return{extend:function(p){n.prototype=this;var o=new n();if(p){o.mixIn(p)}if(!o.hasOwnProperty("init")){o.init=function(){o.$super.init.apply(this,arguments)}}o.init.prototype=o;o.$super=this;return o},create:function(){var o=this.extend();o.init.apply(o,arguments);return o},init:function(){},mixIn:function(p){for(var o in p){if(p.hasOwnProperty(o)){this[o]=p[o]}}if(p.hasOwnProperty("toString")){this.toString=p.toString}},clone:function(){return this.init.prototype.extend(this)}}}());var l=b.WordArray=j.extend({init:function(o,n){o=this.words=o||[];if(n!=g){this.sigBytes=n}else{this.sigBytes=o.length*4}},toString:function(n){return(n||h).stringify(this)},concat:function(t){var q=this.words;var p=t.words;var n=this.sigBytes;var s=t.sigBytes;this.clamp();if(n%4){for(var r=0;r<s;r++){var o=(p[r>>>2]>>>(24-(r%4)*8))&255;q[(n+r)>>>2]|=o<<(24-((n+r)%4)*8)}}else{for(var r=0;r<s;r+=4){q[(n+r)>>>2]=p[r>>>2]}}this.sigBytes+=s;return this},clamp:function(){var o=this.words;var n=this.sigBytes;o[n>>>2]&=4294967295<<(32-(n%4)*8);o.length=e.ceil(n/4)},clone:function(){var n=j.clone.call(this);n.words=this.words.slice(0);return n},random:function(p){var o=[];for(var n=0;n<p;n+=4){o.push((e.random()*4294967296)|0)}return new l.init(o,p)}});var m=a.enc={};var h=m.Hex={stringify:function(p){var r=p.words;var o=p.sigBytes;var q=[];for(var n=0;n<o;n++){var s=(r[n>>>2]>>>(24-(n%4)*8))&255;q.push((s>>>4).toString(16));q.push((s&15).toString(16))}return q.join("")},parse:function(p){var n=p.length;var q=[];for(var o=0;o<n;o+=2){q[o>>>3]|=parseInt(p.substr(o,2),16)<<(24-(o%8)*4)}return new l.init(q,n/2)}};var d=m.Latin1={stringify:function(q){var r=q.words;var p=q.sigBytes;var n=[];for(var o=0;o<p;o++){var s=(r[o>>>2]>>>(24-(o%4)*8))&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(p){var n=p.length;var q=[];for(var o=0;o<n;o++){q[o>>>2]|=(p.charCodeAt(o)&255)<<(24-(o%4)*8)}return new l.init(q,n)}};var c=m.Utf8={stringify:function(n){try{return decodeURIComponent(escape(d.stringify(n)))}catch(o){throw new Error("Malformed UTF-8 data")}},parse:function(n){return d.parse(unescape(encodeURIComponent(n)))}};var i=b.BufferedBlockAlgorithm=j.extend({reset:function(){this._data=new l.init();this._nDataBytes=0},_append:function(n){if(typeof n=="string"){n=c.parse(n)}this._data.concat(n);this._nDataBytes+=n.sigBytes},_process:function(w){var q=this._data;var x=q.words;var n=q.sigBytes;var t=this.blockSize;var v=t*4;var u=n/v;if(w){u=e.ceil(u)}else{u=e.max((u|0)-this._minBufferSize,0)}var s=u*t;var r=e.min(s*4,n);if(s){for(var p=0;p<s;p+=t){this._doProcessBlock(x,p)}var o=x.splice(0,s);q.sigBytes-=r}return new l.init(o,r)},clone:function(){var n=j.clone.call(this);n._data=this._data.clone();return n},_minBufferSize:0});var f=b.Hasher=i.extend({cfg:j.extend(),init:function(n){this.cfg=this.cfg.extend(n);this.reset()},reset:function(){i.reset.call(this);this._doReset()},update:function(n){this._append(n);this._process();return this},finalize:function(n){if(n){this._append(n)}var o=this._doFinalize();return o},blockSize:512/32,_createHelper:function(n){return function(p,o){return new n.init(o).finalize(p)}},_createHmacHelper:function(n){return function(p,o){return new k.HMAC.init(n,o).finalize(p)}}});var k=a.algo={};return a}(Math));
|
||||
/*
|
||||
CryptoJS v3.1.2 x64-core-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 x64-core-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(g){var a=CryptoJS,f=a.lib,e=f.Base,h=f.WordArray,a=a.x64={};a.Word=e.extend({init:function(b,c){this.high=b;this.low=c}});a.WordArray=e.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=g?c:8*b.length},toX32:function(){for(var b=this.words,c=b.length,a=[],d=0;d<c;d++){var e=b[d];a.push(e.high);a.push(e.low)}return h.create(a,this.sigBytes)},clone:function(){for(var b=e.clone.call(this),c=b.words=this.words.slice(0),a=c.length,d=0;d<a;d++)c[d]=c[d].clone();return b}})})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 cipher-core.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 cipher-core.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
CryptoJS.lib.Cipher||function(u){var g=CryptoJS,f=g.lib,k=f.Base,l=f.WordArray,q=f.BufferedBlockAlgorithm,r=g.enc.Base64,v=g.algo.EvpKDF,n=f.Cipher=q.extend({cfg:k.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=b;this.reset()},reset:function(){q.reset.call(this);this._doReset()},process:function(a){this._append(a);
|
||||
return this._process()},finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(a){return{encrypt:function(b,c,d){return("string"==typeof c?s:j).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?s:j).decrypt(a,b,c,d)}}}});f.StreamCipher=n.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var m=g.mode={},t=function(a,b,c){var d=this._iv;d?this._iv=u:d=this._prevBlock;for(var e=
|
||||
@ -35,10 +35,10 @@ blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg
|
||||
b,c,d){d=this.cfg.extend(d);c=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=c.iv;a=j.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return j.decrypt.call(this,a,b,c.key,d)}})}();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 aes.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 aes.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){for(var q=CryptoJS,x=q.lib.BlockCipher,r=q.algo,j=[],y=[],z=[],A=[],B=[],C=[],s=[],u=[],v=[],w=[],g=[],k=0;256>k;k++)g[k]=128>k?k<<1:k<<1^283;for(var n=0,l=0,k=0;256>k;k++){var f=l^l<<1^l<<2^l<<3^l<<4,f=f>>>8^f&255^99;j[n]=f;y[f]=n;var t=g[n],D=g[t],E=g[D],b=257*g[f]^16843008*f;z[n]=b<<24|b>>>8;A[n]=b<<16|b>>>16;B[n]=b<<8|b>>>24;C[n]=b;b=16843009*E^65537*D^257*t^16843008*n;s[f]=b<<24|b>>>8;u[f]=b<<16|b>>>16;v[f]=b<<8|b>>>24;w[f]=b;n?(n=t^g[g[g[E^t]]],l^=g[g[l]]):n=l=1}var F=[0,1,2,4,8,
|
||||
16,32,64,128,27,54],r=r.AES=x.extend({_doReset:function(){for(var c=this._key,e=c.words,a=c.sigBytes/4,c=4*((this._nRounds=a+6)+1),b=this._keySchedule=[],h=0;h<c;h++)if(h<a)b[h]=e[h];else{var d=b[h-1];h%a?6<a&&4==h%a&&(d=j[d>>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255]):(d=d<<8|d>>>24,d=j[d>>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255],d^=F[h/a|0]<<24);b[h]=b[h-a]^d}e=this._invKeySchedule=[];for(a=0;a<c;a++)h=c-a,d=a%4?b[h]:b[h-4],e[a]=4>a||4>=h?d:s[j[d>>>24]]^u[j[d>>>16&255]]^v[j[d>>>
|
||||
@ -46,10 +46,10 @@ code.google.com/p/crypto-js/wiki/License
|
||||
b[k>>>24]^h[p>>>16&255]^d[f>>>8&255]^j[g&255]^a[l++],p=b[p>>>24]^h[f>>>16&255]^d[g>>>8&255]^j[k&255]^a[l++],f=q,g=r,k=s;q=(m[f>>>24]<<24|m[g>>>16&255]<<16|m[k>>>8&255]<<8|m[p&255])^a[l++];r=(m[g>>>24]<<24|m[k>>>16&255]<<16|m[p>>>8&255]<<8|m[f&255])^a[l++];s=(m[k>>>24]<<24|m[p>>>16&255]<<16|m[f>>>8&255]<<8|m[g&255])^a[l++];p=(m[p>>>24]<<24|m[f>>>16&255]<<16|m[g>>>8&255]<<8|m[k&255])^a[l++];c[e]=q;c[e+1]=r;c[e+2]=s;c[e+3]=p},keySize:8});q.AES=x._createHelper(r)})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 tripledes-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 tripledes-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){function j(b,c){var a=(this._lBlock>>>b^this._rBlock)&c;this._rBlock^=a;this._lBlock^=a<<b}function l(b,c){var a=(this._rBlock>>>b^this._lBlock)&c;this._lBlock^=a;this._rBlock^=a<<b}var h=CryptoJS,e=h.lib,n=e.WordArray,e=e.BlockCipher,g=h.algo,q=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],p=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,
|
||||
55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],r=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],s=[{"0":8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,
|
||||
@ -73,19 +73,19 @@ d[k])&t[k])>>>0];this._lBlock=h;this._rBlock=e^g}a=this._lBlock;this._lBlock=thi
|
||||
m.createEncryptor(n.create(b.slice(4,6)))},encryptBlock:function(b,c){this._des1.encryptBlock(b,c);this._des2.decryptBlock(b,c);this._des3.encryptBlock(b,c)},decryptBlock:function(b,c){this._des3.decryptBlock(b,c);this._des2.encryptBlock(b,c);this._des1.decryptBlock(b,c)},keySize:6,ivSize:2,blockSize:2});h.TripleDES=e._createHelper(g)})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 enc-base64.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 enc-base64.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a<f;a+=3)for(var d=(e[a>>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g<f;g++)b.push(c.charAt(d>>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d<
|
||||
e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 md5.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 md5.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(E){function h(a,f,g,j,p,h,k){a=a+(f&g|~f&j)+p+k;return(a<<h|a>>>32-h)+f}function k(a,f,g,j,p,h,k){a=a+(f&j|g&~j)+p+k;return(a<<h|a>>>32-h)+f}function l(a,f,g,j,h,k,l){a=a+(f^g^j)+h+l;return(a<<k|a>>>32-k)+f}function n(a,f,g,j,h,k,l){a=a+(g^(f|~j))+h+l;return(a<<k|a>>>32-k)+f}for(var r=CryptoJS,q=r.lib,F=q.WordArray,s=q.Hasher,q=r.algo,a=[],t=0;64>t;t++)a[t]=4294967296*E.abs(E.sin(t+1))|0;q=q.MD5=s.extend({_doReset:function(){this._hash=new F.init([1732584193,4023233417,2562383102,271733878])},
|
||||
_doProcessBlock:function(m,f){for(var g=0;16>g;g++){var j=f+g,p=m[j];m[j]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360}var g=this._hash.words,j=m[f+0],p=m[f+1],q=m[f+2],r=m[f+3],s=m[f+4],t=m[f+5],u=m[f+6],v=m[f+7],w=m[f+8],x=m[f+9],y=m[f+10],z=m[f+11],A=m[f+12],B=m[f+13],C=m[f+14],D=m[f+15],b=g[0],c=g[1],d=g[2],e=g[3],b=h(b,c,d,e,j,7,a[0]),e=h(e,b,c,d,p,12,a[1]),d=h(d,e,b,c,q,17,a[2]),c=h(c,d,e,b,r,22,a[3]),b=h(b,c,d,e,s,7,a[4]),e=h(e,b,c,d,t,12,a[5]),d=h(d,e,b,c,u,17,a[6]),c=h(c,d,e,b,v,22,a[7]),
|
||||
@ -95,37 +95,37 @@ C,15,a[50]),c=n(c,d,e,b,t,21,a[51]),b=n(b,c,d,e,A,6,a[52]),e=n(e,b,c,d,r,10,a[53
|
||||
4294967296);f[(j+64>>>9<<4)+15]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;f[(j+64>>>9<<4)+14]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360;a.sigBytes=4*(f.length+1);this._process();a=this._hash;f=a.words;for(g=0;4>g;g++)j=f[g],f[g]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360;return a},clone:function(){var a=s.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=s._createHelper(q);r.HmacMD5=s._createHmacHelper(q)})(Math);
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 sha1-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 sha1-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){var k=CryptoJS,b=k.lib,m=b.WordArray,l=b.Hasher,d=[],b=k.algo.SHA1=l.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(n,p){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],j=a[3],b=a[4],c=0;80>c;c++){if(16>c)d[c]=n[p+c]|0;else{var g=d[c-3]^d[c-8]^d[c-14]^d[c-16];d[c]=g<<1|g>>>31}g=(e<<5|e>>>27)+b+d[c];g=20>c?g+((f&h|~f&j)+1518500249):40>c?g+((f^h^j)+1859775393):60>c?g+((f&h|f&j|h&j)-1894007588):g+((f^h^
|
||||
j)-899497514);b=j;j=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+j|0;a[4]=a[4]+b|0},_doFinalize:function(){var b=this._data,d=b.words,a=8*this._nDataBytes,e=8*b.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=Math.floor(a/4294967296);d[(e+64>>>9<<4)+15]=a;b.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var b=l.clone.call(this);b._hash=this._hash.clone();return b}});k.SHA1=l._createHelper(b);k.HmacSHA1=l._createHmacHelper(b)})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 sha256-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 sha256-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(k){for(var g=CryptoJS,h=g.lib,v=h.WordArray,j=h.Hasher,h=g.algo,s=[],t=[],u=function(q){return 4294967296*(q-(q|0))|0},l=2,b=0;64>b;){var d;a:{d=l;for(var w=k.sqrt(d),r=2;r<=w;r++)if(!(d%r)){d=!1;break a}d=!0}d&&(8>b&&(s[b]=u(k.pow(l,0.5))),t[b]=u(k.pow(l,1/3)),b++);l++}var n=[],h=h.SHA256=j.extend({_doReset:function(){this._hash=new v.init(s.slice(0))},_doProcessBlock:function(q,h){for(var a=this._hash.words,c=a[0],d=a[1],b=a[2],k=a[3],f=a[4],g=a[5],j=a[6],l=a[7],e=0;64>e;e++){if(16>e)n[e]=
|
||||
q[h+e]|0;else{var m=n[e-15],p=n[e-2];n[e]=((m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3)+n[e-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+n[e-16]}m=l+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&g^~f&j)+t[e]+n[e];p=((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+(c&d^c&b^d&b);l=j;j=g;g=f;f=k+m|0;k=b;b=d;d=c;c=m+p|0}a[0]=a[0]+c|0;a[1]=a[1]+d|0;a[2]=a[2]+b|0;a[3]=a[3]+k|0;a[4]=a[4]+f|0;a[5]=a[5]+g|0;a[6]=a[6]+j|0;a[7]=a[7]+l|0},_doFinalize:function(){var d=this._data,b=d.words,a=8*this._nDataBytes,c=8*d.sigBytes;
|
||||
b[c>>>5]|=128<<24-c%32;b[(c+64>>>9<<4)+14]=k.floor(a/4294967296);b[(c+64>>>9<<4)+15]=a;d.sigBytes=4*b.length;this._process();return this._hash},clone:function(){var b=j.clone.call(this);b._hash=this._hash.clone();return b}});g.SHA256=j._createHelper(h);g.HmacSHA256=j._createHmacHelper(h)})(Math);
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 sha224-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 sha224-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){var b=CryptoJS,d=b.lib.WordArray,a=b.algo,c=a.SHA256,a=a.SHA224=c.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=c._doFinalize.call(this);a.sigBytes-=4;return a}});b.SHA224=c._createHelper(a);b.HmacSHA224=c._createHmacHelper(a)})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 sha512-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 sha512-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){function a(){return d.create.apply(d,arguments)}for(var n=CryptoJS,r=n.lib.Hasher,e=n.x64,d=e.Word,T=e.WordArray,e=n.algo,ea=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),
|
||||
a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,
|
||||
@ -138,19 +138,19 @@ F=f[0],e=f[1],n=f[2],r=f[3],G=f[4],H=f[5],I=f[6],f=f[7],w=F.high,J=F.low,X=e.hig
|
||||
I.high=ba+S+(P>>>0<D>>>0?1:0);Q=f.low=Q+E;f.high=ca+V+(Q>>>0<E>>>0?1:0)},_doFinalize:function(){var a=this._data,d=a.words,f=8*this._nDataBytes,e=8*a.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+128>>>10<<5)+30]=Math.floor(f/4294967296);d[(e+128>>>10<<5)+31]=f;a.sigBytes=4*d.length;this._process();return this._hash.toX32()},clone:function(){var a=r.clone.call(this);a._hash=this._hash.clone();return a},blockSize:32});n.SHA512=r._createHelper(e);n.HmacSHA512=r._createHmacHelper(e)})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 sha384-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 sha384-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){var c=CryptoJS,a=c.x64,b=a.Word,e=a.WordArray,a=c.algo,d=a.SHA512,a=a.SHA384=d.extend({_doReset:function(){this._hash=new e.init([new b.init(3418070365,3238371032),new b.init(1654270250,914150663),new b.init(2438529370,812702999),new b.init(355462360,4144912697),new b.init(1731405415,4290775857),new b.init(2394180231,1750603025),new b.init(3675008525,1694076839),new b.init(1203062813,3204075428)])},_doFinalize:function(){var a=d._doFinalize.call(this);a.sigBytes-=16;return a}});c.SHA384=
|
||||
d._createHelper(a);c.HmacSHA384=d._createHmacHelper(a)})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 ripemd160-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 ripemd160-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
/*
|
||||
|
||||
@ -170,19 +170,19 @@ a+(((g|~h)^j)+f[2]):64>b?a+((g&j|h&~j)+f[3]):a+((g^(h|~j))+f[4]),a|=0,a=a<<p[b]|
|
||||
d[c>>>5]|=128<<24-c%32;d[(c+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;e.sigBytes=4*(d.length+1);this._process();e=this._hash;d=e.words;for(b=0;5>b;b++)c=d[b],d[b]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return e},clone:function(){var d=p.clone.call(this);d._hash=this._hash.clone();return d}});q.RIPEMD160=p._createHelper(d);q.HmacRIPEMD160=p._createHmacHelper(d)})(Math);
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 hmac.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 hmac.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){var c=CryptoJS,k=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(a,b){a=this._hasher=new a.init;"string"==typeof b&&(b=k.parse(b));var c=a.blockSize,e=4*c;b.sigBytes>e&&(b=a.finalize(b));b.clamp();for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,j=g.words,d=0;d<c;d++)h[d]^=1549556828,j[d]^=909522486;f.sigBytes=g.sigBytes=e;this.reset()},reset:function(){var a=this._hasher;a.reset();a.update(this._iKey)},update:function(a){this._hasher.update(a);return this},finalize:function(a){var b=
|
||||
this._hasher;a=b.finalize(a);b.reset();return b.finalize(this._oKey.clone().concat(a))}})})();
|
||||
|
||||
/*
|
||||
CryptoJS v3.1.2 pbkdf2-min.js
|
||||
code.google.com/p/crypto-js
|
||||
CryptoJS v3.1.2 pbkdf2-min.livingJS
|
||||
code.google.com/p/crypto-livingJS
|
||||
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
code.google.com/p/crypto-livingJS/wiki/License
|
||||
*/
|
||||
(function(){var b=CryptoJS,a=b.lib,d=a.Base,m=a.WordArray,a=b.algo,q=a.HMAC,l=a.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:a.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=q.create(c.hasher,a),g=m.create(),d=m.create([1]),l=g.words,r=d.words,n=c.keySize,c=c.iterations;l.length<n;){var h=f.update(b).finalize(d);f.reset();for(var j=h.words,s=j.length,k=h,p=1;p<c;p++){k=f.finalize(k);f.reset();for(var t=k.words,e=0;e<s;e++)j[e]^=t[e]}g.concat(h);
|
||||
r[0]++}g.sigBytes=4*n;return g}});b.PBKDF2=function(a,b,c){return l.create(c).compute(a,b)}})();
|
||||
|
1
public/faceLoginIE/living-jq.min.js
vendored
Normal file
1
public/faceLoginIE/living-jq.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(_0x12ba10,_0x363f5a){if(typeof define==='function'&&define['amd']){define(['jquery'],_0x363f5a);}else if(typeof exports==='object'){module['exports']=_0x363f5a(require('./js/jquery-3.6.1.min'));}else{_0x12ba10['Living']=_0x363f5a(_0x12ba10['$']);}}(this,function(_0x2283ac){function _0x28601d(_0x4d0a63,_0x2a999c){this['page']=_0x4d0a63;this['token']=_0x2a999c['token'];this['proxy']=_0x2a999c['proxy'];this['timer']=_0x2a999c['timer']||0xf0f5d^0xf284d;this['rate']=_0x2a999c['rate']||0xaff99^0xafffd;this['action']=_0x2a999c['action']||[];this['onDetectStart']=_0x2a999c['onDetectStart']&&typeof _0x2a999c['onDetectStart']==='function'?_0x2a999c['onDetectStart']:function(){};this['onDetectActionProgress']=_0x2a999c['onDetectActionProgress']&&typeof _0x2a999c['onDetectActionProgress']==='function'?_0x2a999c['onDetectActionProgress']:function(){};this['onDetectActionStart']=_0x2a999c['onDetectActionStart']&&typeof _0x2a999c['onDetectActionStart']==='function'?_0x2a999c['onDetectActionStart']:function(){};this['onDetectActionFinish']=_0x2a999c['onDetectActionFinish']&&typeof _0x2a999c['onDetectActionFinish']==='function'?_0x2a999c['onDetectActionFinish']:function(){};this['onDetectFinish']=_0x2a999c['onDetectFinish']&&typeof _0x2a999c['onDetectFinish']==='function'?_0x2a999c['onDetectFinish']:function(){};this['getFacePicture']=_0x2a999c['getFacePicture']&&typeof _0x2a999c['getFacePicture']==='function'?_0x2a999c['getFacePicture']:function(){};this['requestId']='';this['t']=null;}_0x28601d['prototype']={'start':function(){let _0x3378f0=this;this['getRequestId'](function(_0x5c3b12){_0x3378f0['requestId']=_0x5c3b12;_0x3378f0['checking']();_0x3378f0['onDetectStart']();});},'getRequestId':function(_0x37686a){let _0xfd3f05=this;_0x2283ac['ajax']({'type':'get','url':_0xfd3f05['proxy']+'/openapi/livingDetect/v1/getRequestId','dataType':'json','beforeSend':function(_0x5578ed){_0x5578ed['setRequestHeader']('Authorization','Bearer\x20'+_0xfd3f05['token']);},'success':function(_0x8186d6){if(_0x8186d6['code']==='0'){_0x37686a&&_0x37686a(_0x8186d6['data']['requestId']);}},'error':function(_0x3ed909){console['log'](_0x3ed909);}});},'checkAction':function(_0xe33a8c){let _0x1f4ccb=this;this['timeLoop'](_0x1f4ccb['action'][_0xe33a8c])['then'](function(_0x239a5a){_0x1f4ccb['stopLoop']();_0x1f4ccb['onDetectActionFinish'](_0x1f4ccb['action'][_0xe33a8c],{'code':0x1,'msg':'动作检测成功'});if(_0x1f4ccb['action'][_0xe33a8c+(0x1b77b^0x1b77a)]){_0x1f4ccb['checkAction'](_0xe33a8c+(0xb7504^0xb7505));}if(_0xe33a8c===_0x1f4ccb['action']['length']-(0x5f816^0x5f817)){_0x1f4ccb['stop']();_0x1f4ccb['onDetectFinish']({'code':0x1,'msg':'活体检测成功','file':_0x239a5a});}},function(){_0x1f4ccb['stop']();_0x1f4ccb['onDetectActionFinish'](_0x1f4ccb['action'][_0xe33a8c],{'code':0x0,'msg':'动作检测失败'});_0x1f4ccb['onDetectFinish']({'code':0x0,'msg':'活体检测失败'});});},'checking':function(){if(!this['action']['length']){return;}this['checkAction'](0x8171f^0x8171f);},'timeLoop':function(_0x358c73){let _0x3b2170=this;let _0x3d2180=this['rate'];this['onDetectActionStart'](_0x358c73,_0x3b2170['timer']);let _0x57c115=0xdfcde^0xdfcdf;var _0x3e15bf=_0x2283ac['Deferred']();let _0x19a9c8=_0x3b2170['timer'];_0x3b2170['t']=setInterval(function(){if(_0x19a9c8===(0x3a426^0x3a426)){_0x3b2170['stopLoop']();_0x3e15bf['reject']();return;}_0x19a9c8-=_0x3d2180;_0x3b2170['onDetectActionProgress'](_0x358c73,_0x19a9c8);_0x3b2170['upload'](_0x57c115++,_0x358c73,function(_0x4101fe){_0x3e15bf['resolve'](_0x4101fe);},function(){_0x3e15bf['reject']();});},_0x3d2180);return _0x3e15bf['promise']();},'upload':function(_0x31444d,_0x3278d8,_0x31de13,_0xb8cec1){let _0x21beb0=this;let _0xac3985=this['getFacePicture']();var _0x53190b=new FormData();_0x53190b['append']('picFile',_0xac3985['file']);_0x53190b['append']('requestId',_0x21beb0['requestId']||'');_0x53190b['append']('actionType',_0x3278d8);_0x53190b['append']('picSerialNumber',_0x31444d+'');_0x2283ac['ajax']({'type':'POST','url':_0x21beb0['proxy']+'/openapi/livingDetect/v1/start?time='+new Date()['getTime'](),'contentType':![],'processData':![],'beforeSend':function(_0x57d52c){_0x57d52c['setRequestHeader']('Authorization','Bearer\x20'+_0x21beb0['token']);},'data':_0x53190b,'success':function(_0x2d4654){if(_0x2d4654['code']==='0'){if(_0x2d4654['data']['isLiving']==='1'){_0x31de13&&_0x31de13({'file':_0xac3985['file']});}}},'error':function(_0x2da092){console['log'](_0x2da092);_0xb8cec1&&_0xb8cec1();}});},'stopLoop':function(){clearInterval(this['t']);},'stop':function(){this['stopLoop']();this['requestId']='';}};return _0x28601d;}));
|
1
public/faceLoginIE/living.min.js
vendored
1
public/faceLoginIE/living.min.js
vendored
@ -1 +0,0 @@
|
||||
/*Obfuscated by JShaman.com*/import _0x4e5570 from'axios';const service=_0x4e5570['create']({'withCredentials':!![],'timeout':0x493e0});service['interceptors']['response']['use'](_0x4576b6=>{const _0x2cf0d2=_0x4576b6['data'];if(_0x2cf0d2['code']!=='0'){return Promise['reject'](_0x2cf0d2);}else{return _0x2cf0d2;}},_0x39797a=>{console['log']('err:'+_0x39797a);return Promise['reject'](_0x39797a);});const Living=function(_0x484981,_0x4b85f7){this['page']=_0x484981;this['token']=_0x4b85f7['token'];this['proxy']=_0x4b85f7['proxy'];this['timer']=_0x4b85f7['timer']||0x1c557^0x1e247;this['action']=_0x4b85f7['action']||[];this['onDetectStart']=_0x4b85f7['onDetectStart']&&typeof _0x4b85f7['onDetectStart']==='function'?_0x4b85f7['onDetectStart']:()=>{};this['onDetectActionProgress']=_0x4b85f7['onDetectActionProgress']&&typeof _0x4b85f7['onDetectActionProgress']==='function'?_0x4b85f7['onDetectActionProgress']:()=>{};this['onDetectActionStart']=_0x4b85f7['onDetectActionStart']&&typeof _0x4b85f7['onDetectActionStart']==='function'?_0x4b85f7['onDetectActionStart']:()=>{};this['onDetectActionFinish']=_0x4b85f7['onDetectActionFinish']&&typeof _0x4b85f7['onDetectActionFinish']==='function'?_0x4b85f7['onDetectActionFinish']:()=>{};this['onDetectFinish']=_0x4b85f7['onDetectFinish']&&typeof _0x4b85f7['onDetectFinish']==='function'?_0x4b85f7['onDetectFinish']:()=>{};this['getFacePicture']=_0x4b85f7['getFacePicture']&&typeof _0x4b85f7['getFacePicture']==='function'?_0x4b85f7['getFacePicture']:()=>{};this['requestId']='';this['t']=null;};Living['prototype']={'start'(){this['getRequestId'](_0x44585a=>{this['requestId']=_0x44585a;this['checking']();this['onDetectStart']();});},'getRequestId'(_0x218dee){service({'url':this['proxy']+'/openapi/livingDetect/v1/getRequestId','method':'get','headers':{'Authorization':'Bearer\x20'+this['token']}})['then'](_0x2f4ef4=>{_0x218dee&&_0x218dee(_0x2f4ef4['data']['requestId']);})['catch'](_0x353d53=>{});},'checkAction'(_0x59c5df){this['timeLoop'](this['action'][_0x59c5df])['then'](_0x54c88a=>{this['stopLoop']();this['onDetectActionFinish'](this['action'][_0x59c5df],{'code':0x1,'msg':'动作检测成功'});if(this['action'][_0x59c5df+(0xdcb67^0xdcb66)]){this['checkAction'](_0x59c5df+(0x74e70^0x74e71));}if(_0x59c5df===this['action']['length']-(0xb950a^0xb950b)){this['stop']();this['onDetectFinish']({'code':0x1,'msg':'活体检测成功','file':_0x54c88a});}},()=>{this['stop']();this['onDetectActionFinish'](this['action'][_0x59c5df],{'code':0x0,'msg':'动作检测失败'});this['onDetectFinish']({'code':0x0,'msg':'活体检测失败'});});},'checking'(){if(!this['action']['length']){return;}this['checkAction'](0xa3a2b^0xa3a2b);},'timeLoop'(_0x32ae49){this['onDetectActionStart'](_0x32ae49,this['timer']);let _0x39ad80=0xd6f06^0xd6f07;return new Promise((_0x303f4c,_0x52626b)=>{let _0x1b2e0e=this['timer'];this['t']=setInterval(()=>{if(_0x1b2e0e===(0x9c1ab^0x9c1ab)){this['stopLoop']();_0x52626b();return;}_0x1b2e0e-=0xc84fd^0xc8499;this['onDetectActionProgress'](_0x32ae49,_0x1b2e0e);this['upload'](_0x39ad80++,_0x32ae49,_0xe84666=>{_0x303f4c(_0xe84666);},()=>{_0x52626b();});},0x55152^0x55136);});},'upload'(_0x5545cb,_0x467698,_0x50c8e0,_0x476b10){let _0x1fb3e5=this['getFacePicture']();var _0x220463=new FormData();_0x220463['append']('picFile',_0x1fb3e5['file']);_0x220463['append']('requestId',this['requestId']||'');_0x220463['append']('actionType',_0x467698);_0x220463['append']('picSerialNumber',_0x5545cb+'');service({'url':this['proxy']+'/openapi/livingDetect/v1/start?time='+new Date()['getTime'](),'method':'post','headers':{'Authorization':'Bearer\x20'+this['token'],'Content-Type':'multipart/form-data'},'data':_0x220463})['then'](_0x40809d=>{if(_0x40809d['data']['isLiving']==='1'){_0x50c8e0&&_0x50c8e0({'file':_0x1fb3e5['file']});}})['catch'](_0x41359d=>{console['log'](_0x41359d);_0x476b10&&_0x476b10();});},'stopLoop'(){clearInterval(this['t']);},'stop'(){this['stopLoop']();this['requestId']='';}};export default Living;
|
4600
public/faceLoginIE/moment.js
Normal file
4600
public/faceLoginIE/moment.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -14,11 +14,14 @@ export default class FrameFaceLogin extends React.Component {
|
||||
componentDidMount() {
|
||||
// 接收Iframe传递的数据
|
||||
window.addEventListener("message", (e) => {
|
||||
const{detectResult,actionAndTimer} = e.data|| {};
|
||||
if(e.data == 'detectFinish'){
|
||||
const{image,detectResult,actionAndTimer} = e.data|| {};
|
||||
if(image){
|
||||
this.props.faceCompareEvent2(image);
|
||||
}
|
||||
else if(detectResult){
|
||||
this.props.faceCompareEvent(detectResult);
|
||||
}else if(e.data == 'detectStatus'){
|
||||
this.props.faceDetectStatusEvent(actionAndTimer.action, actionAndTimer.timer);
|
||||
}else if(actionAndTimer){
|
||||
this.props.faceDetectStatusEvent(actionAndTimer.arg1, actionAndTimer.arg2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import { history } from 'umi';
|
||||
import cookie from 'react-cookies';
|
||||
import moment from 'moment';
|
||||
import FrameFaceLogin from '../faceLogin/FrameFaceLogin';
|
||||
import Living from './living.min.js';
|
||||
import LivingNotIE from './living.min.js';
|
||||
import { _KJUR } from './jsrsasign-latest-all-min';
|
||||
import { time } from 'echarts';
|
||||
|
||||
@ -38,7 +38,7 @@ const Index: React.FC<{}> = () => {
|
||||
const { TabPane } = Tabs;
|
||||
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
|
||||
const [faceLoginDisable, setFaceLoginDisable] = useState<boolean>(false);
|
||||
const lv = useRef<Living>();
|
||||
const lv = useRef<LivingNotIE>();
|
||||
const [timerShow, setTimeShow] = useState<boolean>(false);
|
||||
const [itemShow, setItemShow] = useState<boolean>(false);
|
||||
const [action, setAction] = useState<number>(1);
|
||||
@ -75,7 +75,7 @@ const Index: React.FC<{}> = () => {
|
||||
*/
|
||||
const liveDetectStart = () => {
|
||||
liveDetectStop();
|
||||
let _lv = new Living(null, {
|
||||
let _lv = new LivingNotIE(null, {
|
||||
timer: 10000,
|
||||
action : [1,3,2],
|
||||
token: setLiveDetectToken(),
|
||||
@ -428,14 +428,26 @@ const Index: React.FC<{}> = () => {
|
||||
return new Blob([uInt8Array], { type: contentType });
|
||||
};
|
||||
|
||||
const IELiveDetectFinish2 = async(data:any) => {
|
||||
console.log(data);
|
||||
setAction(4);
|
||||
hanleFaceSubmit(data, null);
|
||||
}
|
||||
|
||||
//IELiveDetectFinish
|
||||
const IELiveDetectFinish = async (data: any) => {
|
||||
setSubmitLoading(true);
|
||||
setAction(4);
|
||||
hanleFaceSubmit(base64ToBlob(data.file.file), null);
|
||||
if(data.code != 0){
|
||||
console.log(data);
|
||||
setAction(4);
|
||||
hanleFaceSubmit(data.file.file, null);
|
||||
}else{
|
||||
message.error('活体检测失败');
|
||||
setSubmitLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
const UpdateDetectStatus = async(action:number, timer:number)=>{
|
||||
setSubmitLoading(true);
|
||||
setAction(action);
|
||||
setTimer(timer);
|
||||
}
|
||||
@ -581,7 +593,7 @@ const Index: React.FC<{}> = () => {
|
||||
</div>
|
||||
</Form.Item> */}
|
||||
<Form.Item>
|
||||
{!whetherIE.current ? (<video ref={video} width="382" height="200"></video>) : (<FrameFaceLogin faceCompareEvent={IELiveDetectFinish} faceDetectStatusEvent = {UpdateDetectStatus}/>)}
|
||||
{!whetherIE.current ? (<video ref={video} width="382" height="200"></video>) : (<FrameFaceLogin faceCompareEvent2={IELiveDetectFinish2} faceCompareEvent={IELiveDetectFinish} faceDetectStatusEvent = {UpdateDetectStatus}/>)}
|
||||
{/* <video ref={video} width="382" height="200"></video> */}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
|
Reference in New Issue
Block a user