mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2025-09-26 13:16:39 +08:00
1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
'use strict';const _0x412ec3=_0x369d;(function(_0x2eb125,_0x4732f2){const _0x509858=_0x369d,_0x1dce12=_0x2eb125();while(!![]){try{const _0x3e5292=parseInt(_0x509858(0x12b))/0x1+-parseInt(_0x509858(0x12f))/0x2+parseInt(_0x509858(0x12d))/0x3*(parseInt(_0x509858(0x137))/0x4)+parseInt(_0x509858(0x14e))/0x5+parseInt(_0x509858(0x152))/0x6+-parseInt(_0x509858(0x14c))/0x7+parseInt(_0x509858(0x128))/0x8*(-parseInt(_0x509858(0x13b))/0x9);if(_0x3e5292===_0x4732f2)break;else _0x1dce12['push'](_0x1dce12['shift']());}catch(_0x53ea47){_0x1dce12['push'](_0x1dce12['shift']());}}}(_0x3b16,0x37524));var __decorate=this&&this[_0x412ec3(0x13e)]||function(_0x279ed9,_0x3ba519,_0x704e47,_0x485b68){const _0x3cba7f=_0x412ec3;var _0x134d09=arguments[_0x3cba7f(0x153)],_0x13139a=_0x134d09<0x3?_0x3ba519:_0x485b68===null?_0x485b68=Object['getOwnPropertyDescriptor'](_0x3ba519,_0x704e47):_0x485b68,_0x2e313d;if(typeof Reflect===_0x3cba7f(0x132)&&typeof Reflect['decorate']===_0x3cba7f(0x12a))_0x13139a=Reflect[_0x3cba7f(0x142)](_0x279ed9,_0x3ba519,_0x704e47,_0x485b68);else{for(var _0x3ec4f9=_0x279ed9[_0x3cba7f(0x153)]-0x1;_0x3ec4f9>=0x0;_0x3ec4f9--)if(_0x2e313d=_0x279ed9[_0x3ec4f9])_0x13139a=(_0x134d09<0x3?_0x2e313d(_0x13139a):_0x134d09>0x3?_0x2e313d(_0x3ba519,_0x704e47,_0x13139a):_0x2e313d(_0x3ba519,_0x704e47))||_0x13139a;}return _0x134d09>0x3&&_0x13139a&&Object[_0x3cba7f(0x151)](_0x3ba519,_0x704e47,_0x13139a),_0x13139a;},__metadata=this&&this['__metadata']||function(_0x5a066c,_0x16ef47){const _0x7df2a6=_0x412ec3;if(typeof Reflect===_0x7df2a6(0x132)&&typeof Reflect[_0x7df2a6(0x136)]===_0x7df2a6(0x12a))return Reflect[_0x7df2a6(0x136)](_0x5a066c,_0x16ef47);},__param=this&&this[_0x412ec3(0x14f)]||function(_0x187e5e,_0x12bae4){return function(_0x3523f0,_0x34f2ad){_0x12bae4(_0x3523f0,_0x34f2ad,_0x187e5e);};};Object[_0x412ec3(0x151)](exports,_0x412ec3(0x13f),{'value':!![]}),exports[_0x412ec3(0x148)]=void 0x0;function _0x369d(_0xd92fd1,_0x3eae66){const _0x3b1681=_0x3b16();return _0x369d=function(_0x369dca,_0x4a912f){_0x369dca=_0x369dca-0x128;let _0x3d1177=_0x3b1681[_0x369dca];return _0x3d1177;},_0x369d(_0xd92fd1,_0x3eae66);}const common_1=require(_0x412ec3(0x145));function _0x3b16(){const _0x3ddb4a=['includes','HttpException','524636SxpPjX','Injectable','1496060mxMymh','__param','Inject','defineProperty','2492268BaJOCP','length','get','3288ogKwTZ','user','function','280079HYTLbo','token:','369471rndJlw','saveToken','237344FyTFLz','test','onModuleInit','object','ttl','tokens:','REDIS_CLIENT','metadata','8PEIZlM','BAD_REQUEST','redisClient','set','17973wUuudc','del','aaa','__decorate','__esModule','design:paramtypes','admin','decorate','您已在其他设备覆盖登录、请您重新登录!','visitor','@nestjs/common','zRange','HttpStatus','RedisCacheService','invalidateTokens'];_0x3b16=function(){return _0x3ddb4a;};return _0x3b16();}let RedisCacheService=class RedisCacheService{constructor(_0x4e4a52){this['redisClient']=_0x4e4a52;}async[_0x412ec3(0x131)](){}[_0x412ec3(0x130)](){const _0x4aad92=_0x412ec3;return this[_0x4aad92(0x139)][_0x4aad92(0x13a)](_0x4aad92(0x13d),0x6f),0x1;}async[_0x412ec3(0x154)](_0x4a0a2c){const _0x6e2bf1=_0x412ec3,{key:_0x45ac8e}=_0x4a0a2c,_0x8f9169=await this['redisClient'][_0x6e2bf1(0x154)](_0x45ac8e);return await this['redisClient'][_0x6e2bf1(0x154)](_0x45ac8e);}async[_0x412ec3(0x13a)](_0x3a11c5,_0x317ed2){const _0x39f9b7=_0x412ec3;try{const {key:_0x2484dd,val:_0x4171f1}=_0x3a11c5;await this[_0x39f9b7(0x139)]['set'](_0x2484dd,_0x4171f1),_0x317ed2&&await this[_0x39f9b7(0x139)]['expire'](_0x2484dd,_0x317ed2);return;}catch(_0x5894c1){throw new common_1['HttpException'](_0x5894c1,common_1['HttpStatus'][_0x39f9b7(0x138)]);}}async[_0x412ec3(0x133)](_0x385a52){const _0x130a17=_0x412ec3;return await this[_0x130a17(0x139)]['ttl'](_0x385a52);}async['del'](_0x28a1b9){const _0x2161c1=_0x412ec3,{key:_0x15a4a6}=_0x28a1b9;await this[_0x2161c1(0x139)]['del'](_0x15a4a6);return;}async[_0x412ec3(0x12e)](_0x128b5e,_0x437a7d){const _0x15ad67=_0x412ec3,_0x1fd764=await this[_0x15ad67(0x139)][_0x15ad67(0x146)](_0x15ad67(0x134)+_0x128b5e,0x0,-0x1);await this['invalidateTokens'](_0x128b5e,_0x1fd764),this[_0x15ad67(0x139)][_0x15ad67(0x13a)]('token:'+_0x128b5e,_0x437a7d);}async[_0x412ec3(0x149)](_0x421e9f,_0x2a9fc6){_0x2a9fc6['forEach'](_0x21c4ea=>{const _0x17c1d0=_0x369d;this['redisClient'][_0x17c1d0(0x13c)](_0x17c1d0(0x12c)+_0x421e9f+':'+_0x21c4ea);});}async['checkTokenAuth'](_0x40d49e,_0x2e47b5){const _0x4fe1ac=_0x412ec3,{id:_0x3ab541,role:_0x28215b}=_0x2e47b5[_0x4fe1ac(0x129)];if(_0x28215b===_0x4fe1ac(0x144))return!![];const _0x3eb330=await this[_0x4fe1ac(0x139)][_0x4fe1ac(0x154)](_0x4fe1ac(0x12c)+_0x3ab541);if(_0x3eb330===null)return await this['redisClient'][_0x4fe1ac(0x13a)](_0x4fe1ac(0x12c)+_0x3ab541,_0x40d49e),!![];if(_0x3eb330!==_0x40d49e){if(['super',_0x4fe1ac(0x141)][_0x4fe1ac(0x14a)](_0x28215b))return!![];throw new common_1[(_0x4fe1ac(0x14b))](_0x4fe1ac(0x143),common_1[_0x4fe1ac(0x147)]['UNAUTHORIZED']);}}};RedisCacheService=__decorate([(0x0,common_1[_0x412ec3(0x14d)])(),__param(0x0,(0x0,common_1[_0x412ec3(0x150)])(_0x412ec3(0x135))),__metadata(_0x412ec3(0x140),[Object])],RedisCacheService),exports['RedisCacheService']=RedisCacheService; |