一些小优化

This commit is contained in:
小易
2024-02-06 13:43:30 +08:00
parent ce3191109c
commit a19c9e08cc
411 changed files with 513 additions and 470 deletions

View File

@@ -1 +1 @@
'use strict';const _0x1c2874=_0x198e;(function(_0x411e16,_0x1a5805){const _0x3dc14b=_0x198e,_0x55b684=_0x411e16();while(!![]){try{const _0x29699e=-parseInt(_0x3dc14b(0xdc))/0x1+-parseInt(_0x3dc14b(0xc5))/0x2*(-parseInt(_0x3dc14b(0xc1))/0x3)+-parseInt(_0x3dc14b(0xbb))/0x4*(-parseInt(_0x3dc14b(0xde))/0x5)+parseInt(_0x3dc14b(0xc3))/0x6*(parseInt(_0x3dc14b(0xbd))/0x7)+-parseInt(_0x3dc14b(0xb7))/0x8*(parseInt(_0x3dc14b(0xdb))/0x9)+parseInt(_0x3dc14b(0xda))/0xa*(parseInt(_0x3dc14b(0xbc))/0xb)+-parseInt(_0x3dc14b(0xc0))/0xc;if(_0x29699e===_0x1a5805)break;else _0x55b684['push'](_0x55b684['shift']());}catch(_0x467fb9){_0x55b684['push'](_0x55b684['shift']());}}}(_0xcb9c,0xd577b));var __decorate=this&&this['__decorate']||function(_0x862edd,_0x49fa0f,_0x558d59,_0x1d3421){const _0x201aad=_0x198e;var _0x52e306=arguments['length'],_0x388c9c=_0x52e306<0x3?_0x49fa0f:_0x1d3421===null?_0x1d3421=Object[_0x201aad(0xdd)](_0x49fa0f,_0x558d59):_0x1d3421,_0x490f48;if(typeof Reflect===_0x201aad(0xca)&&typeof Reflect[_0x201aad(0xc9)]===_0x201aad(0xb5))_0x388c9c=Reflect['decorate'](_0x862edd,_0x49fa0f,_0x558d59,_0x1d3421);else{for(var _0x44405d=_0x862edd[_0x201aad(0xcc)]-0x1;_0x44405d>=0x0;_0x44405d--)if(_0x490f48=_0x862edd[_0x44405d])_0x388c9c=(_0x52e306<0x3?_0x490f48(_0x388c9c):_0x52e306>0x3?_0x490f48(_0x49fa0f,_0x558d59,_0x388c9c):_0x490f48(_0x49fa0f,_0x558d59))||_0x388c9c;}return _0x52e306>0x3&&_0x388c9c&&Object[_0x201aad(0xe1)](_0x49fa0f,_0x558d59,_0x388c9c),_0x388c9c;},__metadata=this&&this['__metadata']||function(_0x109d7e,_0x9b4d4d){const _0x185280=_0x198e;if(typeof Reflect===_0x185280(0xca)&&typeof Reflect[_0x185280(0xb6)]===_0x185280(0xb5))return Reflect[_0x185280(0xb6)](_0x109d7e,_0x9b4d4d);};Object[_0x1c2874(0xe1)](exports,_0x1c2874(0xd4),{'value':!![]}),exports['FanyiService']=void 0x0;const globalConfig_service_1=require(_0x1c2874(0xd1)),common_1=require(_0x1c2874(0xc2)),axios_1=require(_0x1c2874(0xe0)),crypto=require(_0x1c2874(0xc4));function _0x198e(_0x48cc62,_0x454dd0){const _0xcb9ca0=_0xcb9c();return _0x198e=function(_0x198e33,_0x391abc){_0x198e33=_0x198e33-0xb5;let _0x4c4b33=_0xcb9ca0[_0x198e33];return _0x4c4b33;},_0x198e(_0x48cc62,_0x454dd0);}let FanyiService=class FanyiService{constructor(_0x42e55b){const _0x278967=_0x1c2874;this[_0x278967(0xce)]=_0x42e55b;}async[_0x1c2874(0xb8)](_0x488eab){const _0x1bcd7f=_0x1c2874;if(!_0x488eab)throw new common_1[(_0x1bcd7f(0xc8))](_0x1bcd7f(0xc7),common_1['HttpStatus'][_0x1bcd7f(0xdf)]);const {baiduFanyiAppId:_0x56bd4b,baiduFanyiSecret:_0x271774}=await this[_0x1bcd7f(0xce)][_0x1bcd7f(0xd3)]([_0x1bcd7f(0xd0),_0x1bcd7f(0xd2)]);if(!_0x56bd4b||!_0x271774)throw new common_1['HttpException'](_0x1bcd7f(0xe5),common_1[_0x1bcd7f(0xba)]['BAD_REQUEST']);const _0x47b125=Date[_0x1bcd7f(0xb9)]()[_0x1bcd7f(0xd8)](),_0x49e556=crypto[_0x1bcd7f(0xd7)](_0x1bcd7f(0xbe))['update'](_0x56bd4b+_0x488eab+_0x47b125+_0x271774)[_0x1bcd7f(0xbf)](_0x1bcd7f(0xc6)),_0x267252=_0x1bcd7f(0xcd),_0x549c75={'q':_0x488eab[_0x1bcd7f(0xd8)](),'from':'auto','to':'en','appid':_0x56bd4b,'salt':_0x47b125,'sign':_0x49e556},_0xe5cff=await axios_1[_0x1bcd7f(0xe4)][_0x1bcd7f(0xcf)](_0x267252,_0x549c75,{'headers':{'Content-Type':_0x1bcd7f(0xcb)}}),{from:_0x1d1eec,to:_0x300a0a,trans_result:_0x46bb83,error_code:_0x5781e6,error_msg:_0x3b31c8}=_0xe5cff[_0x1bcd7f(0xd9)];if(_0x5781e6){console[_0x1bcd7f(0xe2)](_0x1bcd7f(0xd6),_0xe5cff);throw new common_1[(_0x1bcd7f(0xc8))](_0x1bcd7f(0xe3)+_0x5781e6+']['+_0x3b31c8+']!',common_1[_0x1bcd7f(0xba)][_0x1bcd7f(0xdf)]);}if(!_0x46bb83||!_0x46bb83[_0x1bcd7f(0xcc)]){console[_0x1bcd7f(0xe2)]('res:\x20',_0xe5cff);throw new common_1['HttpException'](_0x1bcd7f(0xe3)+_0x5781e6+']['+_0x3b31c8+']!',common_1['HttpStatus'][_0x1bcd7f(0xdf)]);}else{}return _0x46bb83[0x0]['dst'];}};function _0xcb9c(){const _0x505ea4=['17324ClQVeM','2549195IwuDlH','5927131SnaTLh','md5','digest','33706812HXQOaS','42NFIOTw','@nestjs/common','6pHWick','crypto','241636rHKKvG','hex','请输入要翻译的内容!','HttpException','decorate','object','application/x-www-form-urlencoded','length','https://fanyi-api.baidu.com/api/trans/vip/translate','globalConfigService','post','baiduFanyiAppId','../globalConfig/globalConfig.service','baiduFanyiSecret','getConfigs','__esModule','FanyiService','res:\x20','createHash','toString','data','50EhNhzg','40797cCcrLR','383859mGbSDM','getOwnPropertyDescriptor','1720sKYDGU','BAD_REQUEST','axios','defineProperty','log','翻译失败[','default','当前管理员还未开放翻译服务、请联系管理员开通吧!','function','metadata','1976nUYuRP','convertToEnglish','now','HttpStatus'];_0xcb9c=function(){return _0x505ea4;};return _0xcb9c();}FanyiService=__decorate([(0x0,common_1['Injectable'])(),__metadata('design:paramtypes',[globalConfig_service_1['GlobalConfigService']])],FanyiService),exports[_0x1c2874(0xd5)]=FanyiService;
'use strict';function _0x2d45(_0x58115e,_0x2f759c){const _0x434f3a=_0x434f();return _0x2d45=function(_0x2d4542,_0x42f6d2){_0x2d4542=_0x2d4542-0x83;let _0x472eb0=_0x434f3a[_0x2d4542];return _0x472eb0;},_0x2d45(_0x58115e,_0x2f759c);}const _0x14d801=_0x2d45;(function(_0xcd0f34,_0xdf6f65){const _0x3d8010=_0x2d45,_0xcc10fe=_0xcd0f34();while(!![]){try{const _0x31b0ec=-parseInt(_0x3d8010(0x92))/0x1+parseInt(_0x3d8010(0x95))/0x2+parseInt(_0x3d8010(0x8e))/0x3+parseInt(_0x3d8010(0x8c))/0x4+-parseInt(_0x3d8010(0xa4))/0x5+-parseInt(_0x3d8010(0xa6))/0x6*(-parseInt(_0x3d8010(0x86))/0x7)+parseInt(_0x3d8010(0x8f))/0x8*(-parseInt(_0x3d8010(0x89))/0x9);if(_0x31b0ec===_0xdf6f65)break;else _0xcc10fe['push'](_0xcc10fe['shift']());}catch(_0x64be43){_0xcc10fe['push'](_0xcc10fe['shift']());}}}(_0x434f,0x8b2eb));function _0x434f(){const _0x1362b4=['Injectable','digest','baiduFanyiAppId','decorate','当前管理员还未开放翻译服务、请联系管理员开通吧!','dst','design:paramtypes','翻译失败[','object','toString','application/x-www-form-urlencoded','__esModule','请输入要翻译的内容!','FanyiService','4109460uWrBgT','now','6favHcY','data','axios','HttpStatus','getOwnPropertyDescriptor','update','createHash','function','globalConfigService','metadata','post','5823223nNaIQr','md5','hex','9gKcVYi','HttpException','BAD_REQUEST','3380480iYpWzA','GlobalConfigService','422082yRvIky','11002192jRwSIR','log','length','168940Yiyplr','res:\x20','defineProperty','2236988TTUZPa'];_0x434f=function(){return _0x1362b4;};return _0x434f();}var __decorate=this&&this['__decorate']||function(_0x168896,_0x216ca6,_0x448ac5,_0x894297){const _0x15676f=_0x2d45;var _0x196506=arguments[_0x15676f(0x91)],_0x2bdd10=_0x196506<0x3?_0x216ca6:_0x894297===null?_0x894297=Object[_0x15676f(0xaa)](_0x216ca6,_0x448ac5):_0x894297,_0x17e9f4;if(typeof Reflect===_0x15676f(0x9e)&&typeof Reflect[_0x15676f(0x99)]===_0x15676f(0xad))_0x2bdd10=Reflect[_0x15676f(0x99)](_0x168896,_0x216ca6,_0x448ac5,_0x894297);else{for(var _0x2cc243=_0x168896[_0x15676f(0x91)]-0x1;_0x2cc243>=0x0;_0x2cc243--)if(_0x17e9f4=_0x168896[_0x2cc243])_0x2bdd10=(_0x196506<0x3?_0x17e9f4(_0x2bdd10):_0x196506>0x3?_0x17e9f4(_0x216ca6,_0x448ac5,_0x2bdd10):_0x17e9f4(_0x216ca6,_0x448ac5))||_0x2bdd10;}return _0x196506>0x3&&_0x2bdd10&&Object[_0x15676f(0x94)](_0x216ca6,_0x448ac5,_0x2bdd10),_0x2bdd10;},__metadata=this&&this['__metadata']||function(_0x3dd1f2,_0x1c2c10){const _0x195cff=_0x2d45;if(typeof Reflect===_0x195cff(0x9e)&&typeof Reflect[_0x195cff(0x84)]==='function')return Reflect['metadata'](_0x3dd1f2,_0x1c2c10);};Object['defineProperty'](exports,_0x14d801(0xa1),{'value':!![]}),exports[_0x14d801(0xa3)]=void 0x0;const globalConfig_service_1=require('../globalConfig/globalConfig.service'),common_1=require('@nestjs/common'),axios_1=require(_0x14d801(0xa8)),crypto=require('crypto');let FanyiService=class FanyiService{constructor(_0x313d62){const _0x37145d=_0x14d801;this[_0x37145d(0x83)]=_0x313d62;}async['convertToEnglish'](_0x39959c){const _0x581129=_0x14d801;if(!_0x39959c)throw new common_1[(_0x581129(0x8a))](_0x581129(0xa2),common_1['HttpStatus']['BAD_REQUEST']);const {baiduFanyiAppId:_0x20475b,baiduFanyiSecret:_0x35d708}=await this[_0x581129(0x83)]['getConfigs']([_0x581129(0x98),'baiduFanyiSecret']);if(!_0x20475b||!_0x35d708)throw new common_1[(_0x581129(0x8a))](_0x581129(0x9a),common_1[_0x581129(0xa9)]['BAD_REQUEST']);const _0x4785dc=Date[_0x581129(0xa5)]()[_0x581129(0x9f)](),_0x52bed9=crypto[_0x581129(0xac)](_0x581129(0x87))[_0x581129(0xab)](_0x20475b+_0x39959c+_0x4785dc+_0x35d708)[_0x581129(0x97)](_0x581129(0x88)),_0x27743e='https://fanyi-api.baidu.com/api/trans/vip/translate',_0x8f4800={'q':_0x39959c['toString'](),'from':'auto','to':'en','appid':_0x20475b,'salt':_0x4785dc,'sign':_0x52bed9},_0xa91e0d=await axios_1['default'][_0x581129(0x85)](_0x27743e,_0x8f4800,{'headers':{'Content-Type':_0x581129(0xa0)}}),{from:_0x572578,to:_0x17a750,trans_result:_0x40e045,error_code:_0x2937a7,error_msg:_0x10a73e}=_0xa91e0d[_0x581129(0xa7)];if(_0x2937a7){console['log']('res:\x20',_0xa91e0d);throw new common_1[(_0x581129(0x8a))]('翻译失败['+_0x2937a7+']['+_0x10a73e+']!',common_1[_0x581129(0xa9)][_0x581129(0x8b)]);}if(!_0x40e045||!_0x40e045[_0x581129(0x91)]){console[_0x581129(0x90)](_0x581129(0x93),_0xa91e0d);throw new common_1[(_0x581129(0x8a))](_0x581129(0x9d)+_0x2937a7+']['+_0x10a73e+']!',common_1[_0x581129(0xa9)]['BAD_REQUEST']);}else{}return _0x40e045[0x0][_0x581129(0x9b)];}};FanyiService=__decorate([(0x0,common_1[_0x14d801(0x96)])(),__metadata(_0x14d801(0x9c),[globalConfig_service_1[_0x14d801(0x8d)]])],FanyiService),exports[_0x14d801(0xa3)]=FanyiService;