Files
fe_service_ebtp_frontend/public/faceLoginIE/living.min.js
2022-10-24 17:06:53 +08:00

2 lines
3.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*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;