YiAi/YiAiQuickDeploy/dist/modules/redisCache/redisCache.service.js
2024-02-05 23:18:50 +08:00

1 line
5.2 KiB
JavaScript

'use strict';function _0x2320(_0x384fbe,_0x3fde9f){const _0x414eea=_0x414e();return _0x2320=function(_0x232016,_0x4257dc){_0x232016=_0x232016-0x16f;let _0x486aea=_0x414eea[_0x232016];return _0x486aea;},_0x2320(_0x384fbe,_0x3fde9f);}const _0x23f207=_0x2320;(function(_0x8d4a7,_0x3e8473){const _0x21b59f=_0x2320,_0x462189=_0x8d4a7();while(!![]){try{const _0x4b19cf=parseInt(_0x21b59f(0x190))/0x1+-parseInt(_0x21b59f(0x17e))/0x2+parseInt(_0x21b59f(0x176))/0x3*(-parseInt(_0x21b59f(0x19b))/0x4)+-parseInt(_0x21b59f(0x18d))/0x5+-parseInt(_0x21b59f(0x18e))/0x6*(parseInt(_0x21b59f(0x175))/0x7)+parseInt(_0x21b59f(0x180))/0x8+parseInt(_0x21b59f(0x185))/0x9;if(_0x4b19cf===_0x3e8473)break;else _0x462189['push'](_0x462189['shift']());}catch(_0x3c0758){_0x462189['push'](_0x462189['shift']());}}}(_0x414e,0xcaa33));var __decorate=this&&this[_0x23f207(0x182)]||function(_0x4759f1,_0x16df6e,_0xe7ea0a,_0x43a7ea){const _0x18f32=_0x23f207;var _0x1e44c3=arguments[_0x18f32(0x192)],_0xa0c0f=_0x1e44c3<0x3?_0x16df6e:_0x43a7ea===null?_0x43a7ea=Object['getOwnPropertyDescriptor'](_0x16df6e,_0xe7ea0a):_0x43a7ea,_0x4bfb2b;if(typeof Reflect===_0x18f32(0x174)&&typeof Reflect['decorate']===_0x18f32(0x172))_0xa0c0f=Reflect['decorate'](_0x4759f1,_0x16df6e,_0xe7ea0a,_0x43a7ea);else{for(var _0x57eeaa=_0x4759f1[_0x18f32(0x192)]-0x1;_0x57eeaa>=0x0;_0x57eeaa--)if(_0x4bfb2b=_0x4759f1[_0x57eeaa])_0xa0c0f=(_0x1e44c3<0x3?_0x4bfb2b(_0xa0c0f):_0x1e44c3>0x3?_0x4bfb2b(_0x16df6e,_0xe7ea0a,_0xa0c0f):_0x4bfb2b(_0x16df6e,_0xe7ea0a))||_0xa0c0f;}return _0x1e44c3>0x3&&_0xa0c0f&&Object['defineProperty'](_0x16df6e,_0xe7ea0a,_0xa0c0f),_0xa0c0f;},__metadata=this&&this[_0x23f207(0x18f)]||function(_0xcdb9f9,_0x50b488){const _0x47ccb6=_0x23f207;if(typeof Reflect==='object'&&typeof Reflect[_0x47ccb6(0x199)]===_0x47ccb6(0x172))return Reflect[_0x47ccb6(0x199)](_0xcdb9f9,_0x50b488);},__param=this&&this[_0x23f207(0x198)]||function(_0x229819,_0x555ded){return function(_0xa8bdc8,_0x36cf87){_0x555ded(_0xa8bdc8,_0x36cf87,_0x229819);};};function _0x414e(){const _0x22f2d6=['super','HttpStatus','20629026FcoOeT','invalidateTokens','get','onModuleInit','admin','del','token:','set','1354655tKTqvE','1542HZacJd','__metadata','393510yVTssG','saveToken','length','test','defineProperty','aaa','includes','tokens:','__param','metadata','BAD_REQUEST','156pDWZwH','forEach','REDIS_CLIENT','visitor','function','user','object','11627TzjyZJ','120144zlXvKg','HttpException','design:paramtypes','checkTokenAuth','ttl','redisClient','Inject','UNAUTHORIZED','2209214WhzviP','RedisCacheService','12069328dBXljs','您已在其他设备覆盖登录、请您重新登录!','__decorate'];_0x414e=function(){return _0x22f2d6;};return _0x414e();}Object[_0x23f207(0x194)](exports,'__esModule',{'value':!![]}),exports['RedisCacheService']=void 0x0;const common_1=require('@nestjs/common');let RedisCacheService=class RedisCacheService{constructor(_0x11e2ac){const _0x915df2=_0x23f207;this[_0x915df2(0x17b)]=_0x11e2ac;}async[_0x23f207(0x188)](){}[_0x23f207(0x193)](){const _0x53152b=_0x23f207;return this['redisClient'][_0x53152b(0x18c)](_0x53152b(0x195),0x6f),0x1;}async[_0x23f207(0x187)](_0x1cbbb2){const _0x21e63d=_0x23f207,{key:_0x1303d7}=_0x1cbbb2,_0x251028=await this[_0x21e63d(0x17b)][_0x21e63d(0x187)](_0x1303d7);return await this[_0x21e63d(0x17b)][_0x21e63d(0x187)](_0x1303d7);}async[_0x23f207(0x18c)](_0x5476a2,_0x36c7ab){const _0x5ecbc0=_0x23f207;try{const {key:_0x396ed4,val:_0x3f5f25}=_0x5476a2;await this[_0x5ecbc0(0x17b)][_0x5ecbc0(0x18c)](_0x396ed4,_0x3f5f25),_0x36c7ab&&await this[_0x5ecbc0(0x17b)]['expire'](_0x396ed4,_0x36c7ab);return;}catch(_0x4dc783){throw new common_1[(_0x5ecbc0(0x177))](_0x4dc783,common_1[_0x5ecbc0(0x184)][_0x5ecbc0(0x19a)]);}}async[_0x23f207(0x17a)](_0x2af6cf){const _0x1f7bd5=_0x23f207;return await this['redisClient'][_0x1f7bd5(0x17a)](_0x2af6cf);}async[_0x23f207(0x18a)](_0x6dcad1){const _0x4bffb0=_0x23f207,{key:_0x49fd40}=_0x6dcad1;await this['redisClient'][_0x4bffb0(0x18a)](_0x49fd40);return;}async[_0x23f207(0x191)](_0x2a5037,_0x4521ef){const _0x31377f=_0x23f207,_0x5c98ee=await this[_0x31377f(0x17b)]['zRange'](_0x31377f(0x197)+_0x2a5037,0x0,-0x1);await this[_0x31377f(0x186)](_0x2a5037,_0x5c98ee),this[_0x31377f(0x17b)][_0x31377f(0x18c)]('token:'+_0x2a5037,_0x4521ef);}async[_0x23f207(0x186)](_0x1040b9,_0xca7ab0){const _0x3e0336=_0x23f207;_0xca7ab0[_0x3e0336(0x16f)](_0x182b17=>{const _0x2c7aed=_0x3e0336;this[_0x2c7aed(0x17b)]['del'](_0x2c7aed(0x18b)+_0x1040b9+':'+_0x182b17);});}async[_0x23f207(0x179)](_0xc8b554,_0x4bdba1){const _0x46739f=_0x23f207,{id:_0x211e66,role:_0xedced6}=_0x4bdba1[_0x46739f(0x173)];if(_0xedced6===_0x46739f(0x171))return!![];const _0x581a8b=await this[_0x46739f(0x17b)]['get'](_0x46739f(0x18b)+_0x211e66);if(_0x581a8b===null)return await this[_0x46739f(0x17b)][_0x46739f(0x18c)](_0x46739f(0x18b)+_0x211e66,_0xc8b554),!![];if(_0x581a8b!==_0xc8b554){if([_0x46739f(0x183),_0x46739f(0x189)][_0x46739f(0x196)](_0xedced6))return!![];throw new common_1[(_0x46739f(0x177))](_0x46739f(0x181),common_1[_0x46739f(0x184)][_0x46739f(0x17d)]);}}};RedisCacheService=__decorate([(0x0,common_1['Injectable'])(),__param(0x0,(0x0,common_1[_0x23f207(0x17c)])(_0x23f207(0x170))),__metadata(_0x23f207(0x178),[Object])],RedisCacheService),exports[_0x23f207(0x17f)]=RedisCacheService;