YiAi/YiAiQuickDeploy/dist/modules/globalConfig/globalConfig.service.js
2024-07-02 16:38:26 +08:00

1 line
21 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.

'use strict';function _0x420b(_0xec5d1c,_0x5c47d5){const _0x575df1=_0x575d();return _0x420b=function(_0x420ba1,_0x42c97c){_0x420ba1=_0x420ba1-0x12a;let _0x4a6c7f=_0x575df1[_0x420ba1];return _0x4a6c7f;},_0x420b(_0xec5d1c,_0x5c47d5);}const _0x513b=_0x420b;(function(_0x142caa,_0x599cc0){const _0x38a304=_0x420b,_0x3df9bb=_0x142caa();while(!![]){try{const _0x2691bd=-parseInt(_0x38a304(0x1c6))/0x1*(parseInt(_0x38a304(0x169))/0x2)+-parseInt(_0x38a304(0x14c))/0x3*(parseInt(_0x38a304(0x130))/0x4)+-parseInt(_0x38a304(0x15d))/0x5*(parseInt(_0x38a304(0x15e))/0x6)+-parseInt(_0x38a304(0x1ea))/0x7+-parseInt(_0x38a304(0x17a))/0x8*(parseInt(_0x38a304(0x1ad))/0x9)+-parseInt(_0x38a304(0x158))/0xa+parseInt(_0x38a304(0x164))/0xb;if(_0x2691bd===_0x599cc0)break;else _0x3df9bb['push'](_0x3df9bb['shift']());}catch(_0x5bb7bb){_0x3df9bb['push'](_0x3df9bb['shift']());}}}(_0x575d,0x1b6c9));var __decorate=this&&this[_0x513b(0x1c1)]||function(_0x160b3e,_0x12a6ab,_0x8eceed,_0x1d9a10){const _0x551a2d=_0x513b;var _0x1a173e=arguments['length'],_0x1e2ac0=_0x1a173e<0x3?_0x12a6ab:_0x1d9a10===null?_0x1d9a10=Object[_0x551a2d(0x1b3)](_0x12a6ab,_0x8eceed):_0x1d9a10,_0x2135c4;if(typeof Reflect===_0x551a2d(0x165)&&typeof Reflect['decorate']===_0x551a2d(0x1c8))_0x1e2ac0=Reflect[_0x551a2d(0x1ca)](_0x160b3e,_0x12a6ab,_0x8eceed,_0x1d9a10);else{for(var _0x28d415=_0x160b3e[_0x551a2d(0x14d)]-0x1;_0x28d415>=0x0;_0x28d415--)if(_0x2135c4=_0x160b3e[_0x28d415])_0x1e2ac0=(_0x1a173e<0x3?_0x2135c4(_0x1e2ac0):_0x1a173e>0x3?_0x2135c4(_0x12a6ab,_0x8eceed,_0x1e2ac0):_0x2135c4(_0x12a6ab,_0x8eceed))||_0x1e2ac0;}return _0x1a173e>0x3&&_0x1e2ac0&&Object[_0x551a2d(0x177)](_0x12a6ab,_0x8eceed,_0x1e2ac0),_0x1e2ac0;},__metadata=this&&this['__metadata']||function(_0x4672a0,_0x5abc42){const _0x39c8a4=_0x513b;if(typeof Reflect===_0x39c8a4(0x165)&&typeof Reflect[_0x39c8a4(0x17c)]==='function')return Reflect['metadata'](_0x4672a0,_0x5abc42);},__param=this&&this[_0x513b(0x1f3)]||function(_0x4abb44,_0x33a44e){return function(_0x2cff73,_0x5f2197){_0x33a44e(_0x2cff73,_0x5f2197,_0x4abb44);};};Object['defineProperty'](exports,_0x513b(0x1ba),{'value':!![]}),exports[_0x513b(0x18a)]=void 0x0;const models_service_1=require(_0x513b(0x1e7)),chatLog_entity_1=require('../chatLog/chatLog.entity'),common_1=require('@nestjs/common'),config_entity_1=require(_0x513b(0x1b1)),typeorm_1=require(_0x513b(0x179)),typeorm_2=require('typeorm'),utils_1=require(_0x513b(0x1c2)),axios_1=require('axios'),fs=require('fs'),packageJsonContent=fs['readFileSync'](_0x513b(0x13a),'utf-8'),packageJson=JSON[_0x513b(0x137)](packageJsonContent),version=packageJson['version'];function _0x575d(){const _0x12fc2c=['InjectRepository','隐私内容、非超级管理员无权查看','invitedGuestSendDrawMjCount','design:paramtypes','BAD_REQUEST','configVal','copyrightUrl','firstRregisterSendModel4Count','&client_secret=','HttpException','GlobalConfigService','payWeChatPrivateKey','mpay','baiduTextApiKey','https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=','ticket','error','baidu','mjProxy','OfficialService','ali','siteRobotName','access_token','delete','gpt','ISDEV','post','Status','chatGptKey','payHupiStatus','registerSendModel4Count','aliPhoneTemplateCode','getCopyright','tencent','https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=','缺失ip信息','salesSeniorRatio','&type=jsapi','queryGptKeys','baiduTextAccessToken','wechatAccessToken','请按要求填写正确的授权信息','emailLoginStatus','clientHomePath','Repository','1117170PhwSnJ','getNamespace','payWechatStatus','Like','./config.entity','salesAllowDrawMoney','getOwnPropertyDescriptor','signInMjDrawToken','getSignatureGiftConfig','baiduTextStatus','signInStatus','inviteGiveSendModel3Count','chatGptKey:','__esModule','queryFrontConfig','cos','error_description','hideString','robotAvatar','设置完成!','__decorate','../../common/utils','queryPayType','ChatLogEntity','json','163yBtkLf','registerSendStatus','function','application/json','decorate','https://aip.baidubce.com/oauth/2.0/token?client_id=','initGetAllConfig','nineAiToken','chatLogEntity','手机验证码功能暂未开放!','wechat','&grant_type=client_credentials','百度敏感词初始化失败,如果需要敏感检测、请前往后台系统配置!','globalConfigs','response','configs','super','isVerifyEmail','vxNumber','hupi','configKey','签到功能暂未开放!','noticeInfo','entries','epay','baiduCode','mjUseBaiduFy','Logger','baiduTextSecretKey','invitedGuestSendModel4Count','nineai','debug','noticeTitle','../models/models.service','clientLogoPath','&secret=','418824vueSkP','data','TRUE','HttpStatus','every','firstRegisterSendRank','modelsService','phoneRegisterStatus','copyrightTitle','__param','获取微信access_token失败、错误信息','domain','queryNotice','createOrUpdate','getWechatAccessToken','设置配置信息错误!','15604NoyMhE','siteName','map','nineaiBuiltInSensitiveApiBase','appMenuHeaderTips','payEpayStatus','registerSendModel3Count','parse','auth','env','package.json','payMpayStatus','forEach','user','NINEAI','getSensitiveConfig','reduce','wechatOfficialAppSecret','payWeChatPublicKey','invitedGuestSendModel3Count','buyCramiAddress','signInModel4Count','fetchBaseAccessToken','支付功能暂未开放!','initBaiduSensitive','qqNumber','openaiBaseUrl','wechatRegisterStatus','81TdxfOZ','length','nineaiBuiltInSensitiveAuthKey','nineaiBuiltInSensitiveStatus','get','default','aliPhoneAccessKeySecret','inviteGiveSendModel4Count','fetchJsapiTicket','assign','mindDefaultData','firstRegisterSendStatus','332370yDYIkW','phoneLoginStatus','请配置正确的秘钥、当前秘钥检测不通过!','appMenuHeaderBgUrl','还未配置微信的appId和secret、配置后才可进行微信扫码登录','30695ipmsxE','102HqnRUc','find','mjProxyImgUrl','ConfigEntity','isUseWxLogin','\x20current\x20use\x20version\x20in\x20------>:\x20','8251540kZmHuO','object','wechatJsapiTicket','getNineAiToken','NAMESPACE','2588YDVfHq','Key','queryConfig','ModelsService','configEntity','MjdrawCount','payEpayChannel','log','update','Injectable','wechatSilentLoginStatus','includes','inviteSendStatus','registerBaseUrl','defineProperty','getConfigs','@nestjs/typeorm','8yhmadE','getPhoneVerifyConfig','metadata','setConfig','getAuthInfo','wechatOfficialAppId'];_0x575d=function(){return _0x12fc2c;};return _0x575d();}console[_0x513b(0x170)](_0x513b(0x163),version);let GlobalConfigService=class GlobalConfigService{constructor(_0x5020dd,_0x1cbb30,_0x5007ab){const _0x2f2da7=_0x513b;this['configEntity']=_0x5020dd,this[_0x2f2da7(0x1ce)]=_0x1cbb30,this[_0x2f2da7(0x1f0)]=_0x5007ab,this['globalConfigs']={},this[_0x2f2da7(0x1cd)]=!![];}async['onModuleInit'](){const _0x267033=_0x513b;await this[_0x267033(0x1cc)]();}async['getConfigs'](_0x52e045){const _0x4e8bca=_0x513b;if(_0x52e045[_0x4e8bca(0x14d)]===0x0)return;if(_0x52e045['includes'](_0x4e8bca(0x1a8))&&_0x52e045[_0x4e8bca(0x14d)]===0x1)return this[_0x4e8bca(0x1a8)];if(_0x52e045[_0x4e8bca(0x174)]('wechatJsapiTicket')&&_0x52e045[_0x4e8bca(0x14d)]===0x1)return this[_0x4e8bca(0x166)];if(_0x52e045[_0x4e8bca(0x14d)]===0x1)return this[_0x4e8bca(0x1d3)][_0x52e045[0x0]];else{const _0x54bfaa={};return _0x52e045[_0x4e8bca(0x13c)](_0x441dbf=>_0x54bfaa[_0x441dbf]=this[_0x4e8bca(0x1d3)][_0x441dbf]),_0x54bfaa;}}async[_0x513b(0x1cc)](){const _0x5cf9da=_0x513b,_0x40eec8=await this[_0x5cf9da(0x16d)][_0x5cf9da(0x15f)]();this[_0x5cf9da(0x1d3)]=_0x40eec8[_0x5cf9da(0x140)]((_0x607fd3,_0x5cff94)=>{const _0x5e4b3a=_0x5cf9da;return _0x607fd3[_0x5cff94['configKey']]=_0x5cff94[_0x5e4b3a(0x185)],_0x607fd3;},{}),this[_0x5cf9da(0x148)]();}async[_0x513b(0x148)](_0x901d6e=!![]){const _0x29482d=_0x513b,{baiduTextApiKey:_0x15bddd,baiduTextSecretKey:_0x3eddba}=await this[_0x29482d(0x178)]([_0x29482d(0x18d),_0x29482d(0x1e2)]);if(!_0x15bddd||!_0x3eddba){common_1[_0x29482d(0x1e1)][_0x29482d(0x190)](_0x29482d(0x1d2),_0x29482d(0x18a));return;}const _0xa10a5b={'Content-Type':_0x29482d(0x1c9),'Accept':_0x29482d(0x1c9)},_0x40ebe3=_0x29482d(0x1cb)+_0x15bddd+_0x29482d(0x188)+_0x3eddba+_0x29482d(0x1d1);try{const _0x49bb09=await axios_1[_0x29482d(0x151)][_0x29482d(0x19a)](_0x40ebe3,{'headers':_0xa10a5b});this[_0x29482d(0x1d3)][_0x29482d(0x1a7)]=_0x49bb09['data'][_0x29482d(0x196)];}catch(_0x32e82f){if(_0x901d6e)common_1[_0x29482d(0x1e1)][_0x29482d(0x190)]('百度敏感词配置检测失败,您的参数可能配置的不正确!','GlobalConfigService');else throw new common_1['HttpException'](_0x32e82f[_0x29482d(0x1d4)][_0x29482d(0x1eb)][_0x29482d(0x1bd)],common_1['HttpStatus']['BAD_REQUEST']);}}async[_0x513b(0x12e)](_0x379051=![]){const _0xa13e75=_0x513b,{wechatOfficialAppId:_0x35adef,wechatOfficialAppSecret:_0x1a147f}=await this[_0xa13e75(0x178)]([_0xa13e75(0x17f),_0xa13e75(0x141)]);if(!_0x35adef||!_0x1a147f)return common_1[_0xa13e75(0x1e1)][_0xa13e75(0x190)](_0xa13e75(0x15c),'OfficialService');this[_0xa13e75(0x1a8)]=await this[_0xa13e75(0x146)](_0x35adef,_0x1a147f,_0x379051),this[_0xa13e75(0x166)]=await this[_0xa13e75(0x154)](this['wechatAccessToken']),common_1[_0xa13e75(0x1e1)][_0xa13e75(0x170)]('wechat\x20refresh\x20access_token\x20\x20==>\x20'+this['wechatAccessToken'],_0xa13e75(0x193));}async['fetchBaseAccessToken'](_0x4a9213,_0x2a8469,_0x10db45=![]){const _0x32f149=_0x513b;if(process[_0x32f149(0x139)][_0x32f149(0x199)]===_0x32f149(0x1ec)){this[_0x32f149(0x1a8)]='';return;}const {data:{errmsg:_0x3ca160,access_token:_0x2057fd}}=await axios_1['default']['get'](_0x32f149(0x18e)+_0x4a9213+_0x32f149(0x1e9)+_0x2a8469);if(_0x3ca160){if(_0x10db45)common_1[_0x32f149(0x1e1)][_0x32f149(0x190)](_0x32f149(0x12a)+_0x3ca160,_0x32f149(0x193));else throw new common_1[(_0x32f149(0x189))](_0x32f149(0x15a),common_1[_0x32f149(0x1ed)][_0x32f149(0x184)]);return'';}return _0x2057fd;}async[_0x513b(0x154)](_0x27e6e7){const _0x19e06d=_0x513b;var _0x4a1036;if(process[_0x19e06d(0x139)][_0x19e06d(0x199)]==='TRUE'){this[_0x19e06d(0x166)]='';return;}const _0x4eb756=await axios_1['default'][_0x19e06d(0x150)](_0x19e06d(0x1a2)+_0x27e6e7+_0x19e06d(0x1a5));return(_0x4a1036=_0x4eb756===null||_0x4eb756===void 0x0?void 0x0:_0x4eb756[_0x19e06d(0x1eb)])===null||_0x4a1036===void 0x0?void 0x0:_0x4a1036[_0x19e06d(0x18f)];}async['queryAllConfig'](_0x5b2de3){const _0x12f11a=_0x513b,{role:_0x32a5ac}=_0x5b2de3[_0x12f11a(0x13d)];return this[_0x12f11a(0x1d3)];}async[_0x513b(0x1bb)](_0x5a1f3d,_0x247db5){const _0x4855c5=_0x513b,_0x8c3371=['vxNumber',_0x4855c5(0x1c7),_0x4855c5(0x136),_0x4855c5(0x19e),'registerSendDrawMjCount',_0x4855c5(0x157),_0x4855c5(0x1ef),'firstRregisterSendModel3Count',_0x4855c5(0x187),'firstRregisterSendDrawMjCount',_0x4855c5(0x175),_0x4855c5(0x1b8),_0x4855c5(0x153),'inviteGiveSendDrawMjCount',_0x4855c5(0x143),_0x4855c5(0x1e3),_0x4855c5(0x182),_0x4855c5(0x1ab),_0x4855c5(0x1e8),'clientFavoIconPath',_0x4855c5(0x162),_0x4855c5(0x131),_0x4855c5(0x1bf),_0x4855c5(0x195),_0x4855c5(0x144),_0x4855c5(0x156),_0x4855c5(0x1df),_0x4855c5(0x16f),'payMpayChannel','payEpayApiPayUrl','payEpayStatus',_0x4855c5(0x19d),_0x4855c5(0x1af),_0x4855c5(0x13b),'isAutoOpenNotice','isShowAppCatIcon','salesBaseRatio',_0x4855c5(0x1a4),_0x4855c5(0x1b2),'companyName','filingNumber',_0x4855c5(0x1f1),'emailRegisterStatus',_0x4855c5(0x1aa),_0x4855c5(0x159),_0x4855c5(0x14b),_0x4855c5(0x173),_0x4855c5(0x1b7),'signInModel3Count',_0x4855c5(0x145),_0x4855c5(0x1b4),_0x4855c5(0x134),_0x4855c5(0x15b),_0x4855c5(0x1e0),'mjHideNotBlock','mjHideWorkIn',_0x4855c5(0x1d7)],_0x55cb5e=await this[_0x4855c5(0x16d)][_0x4855c5(0x15f)]({'where':{'configKey':(0x0,typeorm_2['In'])(_0x8c3371)}}),{domain:_0x2bb933}=_0x5a1f3d,_0xbc7df0=this[_0x4855c5(0x1d3)]['domain'];_0xbc7df0!==_0x2bb933&&(this[_0x4855c5(0x12d)]({'configKey':_0x4855c5(0x12b),'configVal':_0x2bb933,'status':0x1}),await this[_0x4855c5(0x1cc)]());const _0x2ba603=_0x55cb5e[_0x4855c5(0x140)]((_0x13657c,_0x210cdc)=>{const _0x56823c=_0x4855c5;return _0x13657c[_0x210cdc[_0x56823c(0x1da)]]=_0x210cdc['configVal'],_0x13657c;},{}),{wechatOfficialAppId:_0x57f0f1,wechatOfficialAppSecret:_0x5bf8dd}=await this[_0x4855c5(0x178)]([_0x4855c5(0x17f),'wechatOfficialAppSecret']),_0x30ae26=!!(_0x57f0f1&&_0x5bf8dd);return Object['assign'](Object[_0x4855c5(0x155)]({},_0x2ba603),{'isUseWxLogin':_0x30ae26});}async[_0x513b(0x1a6)](_0x34b2a7){const _0x3e8c35=_0x513b,{role:_0x56f069}=_0x34b2a7['user'],_0xfb0f43=await this['configEntity'][_0x3e8c35(0x15f)]({'where':{'configKey':(0x0,typeorm_2[_0x3e8c35(0x1b0)])('%'+'chatGptKey'+'%')}});if(_0x56f069===_0x3e8c35(0x1d6))return _0xfb0f43;return _0xfb0f43[_0x3e8c35(0x132)](_0x211e48=>{const _0x451827=_0x3e8c35;return _0x211e48[_0x451827(0x185)]=(0x0,utils_1[_0x451827(0x1be)])(_0x211e48[_0x451827(0x185)]),_0x211e48;});}async['setGptKeys'](_0x415288){const _0x6cc9d1=_0x513b,_0x5d9505=_0x415288[_0x6cc9d1(0x1d5)]['filter'](_0x5f035c=>_0x5f035c['configVal']),_0x5e1c34=_0x5d9505[_0x6cc9d1(0x132)](_0x5a9a31=>_0x5a9a31[_0x6cc9d1(0x1da)]);for(const [_0x37a730,_0x375d50]of _0x5d9505[_0x6cc9d1(0x1dd)]()){const {configKey:_0x2cdc0e,configVal:_0x1302af,status:_0x2cf8a0}=_0x375d50;await this[_0x6cc9d1(0x12d)]({'configKey':_0x6cc9d1(0x1b9)+(_0x37a730+0x1),'configVal':_0x1302af,'status':_0x2cf8a0});}const _0x243f15=await this[_0x6cc9d1(0x16d)]['find']({'where':{'configKey':(0x0,typeorm_2[_0x6cc9d1(0x1b0)])('%'+_0x6cc9d1(0x19c)+'%')}}),_0x204068=_0x243f15[_0x6cc9d1(0x132)](_0x5bd03a=>_0x5bd03a[_0x6cc9d1(0x1da)]);if(_0x204068[_0x6cc9d1(0x14d)]>_0x5e1c34['length']){const _0x5f14a5=(0x0,utils_1['getDiffArray'])(_0x204068[_0x6cc9d1(0x14d)],_0x5e1c34[_0x6cc9d1(0x14d)],'chatGptKey:');for(const _0x5d41a7 of _0x5f14a5){await this[_0x6cc9d1(0x16d)][_0x6cc9d1(0x197)]({'configKey':_0x5d41a7});}}return await this['initGetAllConfig'](),'操作完成!';}async[_0x513b(0x16b)](_0x433ec3,_0x1961f7){const _0x413b77=_0x513b,{role:_0x4b89a9}=_0x1961f7[_0x413b77(0x13d)],{keys:_0x4c8e8d}=_0x433ec3,_0x27e2de=await this['configEntity'][_0x413b77(0x15f)]({'where':{'configKey':(0x0,typeorm_2['In'])(_0x4c8e8d)}});return _0x4b89a9!==_0x413b77(0x1d6)&&_0x27e2de[_0x413b77(0x13c)](_0x277e6a=>{const _0x1880df=_0x413b77;if(_0x277e6a['configKey']['includes']('mj')||_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)](_0x1880df(0x16a))||_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)](_0x1880df(0x198))||_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)](_0x1880df(0x1bc))||_0x277e6a['configKey'][_0x1880df(0x174)](_0x1880df(0x191))||_0x277e6a[_0x1880df(0x1da)]['includes'](_0x1880df(0x194))||_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)](_0x1880df(0x1a1))||_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)]('pay')||_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)](_0x1880df(0x1d0))||_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)](_0x1880df(0x160))||_0x277e6a[_0x1880df(0x1da)]===_0x1880df(0x14a)){const _0x116121=[_0x1880df(0x142),_0x1880df(0x18b)];if(_0x116121[_0x1880df(0x174)](_0x277e6a[_0x1880df(0x1da)]))return _0x277e6a[_0x1880df(0x185)]=(0x0,utils_1[_0x1880df(0x1be)])(_0x277e6a[_0x1880df(0x185)],_0x1880df(0x181));const _0x2813f8=[_0x1880df(0x135),'payHupiStatus',_0x1880df(0x192)];!_0x2813f8[_0x1880df(0x174)](_0x277e6a[_0x1880df(0x1da)])&&!_0x277e6a[_0x1880df(0x1da)][_0x1880df(0x174)](_0x1880df(0x19b))&&(_0x277e6a['configVal']=(0x0,utils_1[_0x1880df(0x1be)])(_0x277e6a[_0x1880df(0x185)]));}}),_0x27e2de[_0x413b77(0x140)]((_0x5ea7f2,_0x212989)=>{const _0x3d2ff0=_0x413b77;return _0x5ea7f2[_0x212989[_0x3d2ff0(0x1da)]]=_0x212989[_0x3d2ff0(0x185)],_0x5ea7f2;},{});}[_0x513b(0x167)](){const _0x12df26=_0x513b,_0xf96cdb=this[_0x12df26(0x1d3)][_0x12df26(0x16e)],_0x25db9c=this[_0x12df26(0x1cd)];return!_0x25db9c||Number(_0xf96cdb)===0x1;}async[_0x513b(0x17d)](_0x5b74b7){const _0x37bf07=_0x513b;try{const {settings:_0x36a716}=_0x5b74b7;for(const _0x530081 of _0x36a716){await this[_0x37bf07(0x12d)](_0x530081);}await this['initGetAllConfig']();const _0x12796e=_0x36a716[_0x37bf07(0x132)](_0x589781=>_0x589781[_0x37bf07(0x1da)]);return(_0x12796e[_0x37bf07(0x174)]('baiduTextApiKey')||_0x12796e[_0x37bf07(0x174)](_0x37bf07(0x1e2)))&&await this[_0x37bf07(0x148)](![]),(_0x12796e['includes'](_0x37bf07(0x17f))||_0x12796e[_0x37bf07(0x174)](_0x37bf07(0x141)))&&await this[_0x37bf07(0x12e)](),_0x37bf07(0x1c0);}catch(_0x5b39fd){console[_0x37bf07(0x170)]('error:\x20',_0x5b39fd);}}async[_0x513b(0x12d)](_0x20ce6e){const _0xcd57e5=_0x513b;try{const {configKey:_0x481531,configVal:_0x29b21a,status:status=0x1}=_0x20ce6e,_0x49492c=await this[_0xcd57e5(0x16d)]['findOne']({'where':{'configKey':_0x481531}});if(_0x49492c){const _0x2f7c2a=await this['configEntity'][_0xcd57e5(0x171)]({'configKey':_0x481531},{'configVal':_0x29b21a,'status':status});}else{const _0x5a6139=await this['configEntity']['save']({'configKey':_0x481531,'configVal':_0x29b21a,'status':status});}}catch(_0x104325){console[_0xcd57e5(0x170)]('error:\x20',_0x104325);throw new common_1[(_0xcd57e5(0x189))](_0xcd57e5(0x12f),common_1[_0xcd57e5(0x1ed)][_0xcd57e5(0x184)]);}}async[_0x513b(0x12c)](){const _0x2bef5=_0x513b;return await this[_0x2bef5(0x178)]([_0x2bef5(0x1dc),_0x2bef5(0x1e6)]);}async[_0x513b(0x1a0)](){const _0x483dd1=_0x513b;return await this[_0x483dd1(0x178)]([_0x483dd1(0x186),_0x483dd1(0x1f2)]);}async[_0x513b(0x1c3)](){const _0x30e422=_0x513b,{payHupiStatus:payHupiStatus=0x0,payEpayStatus:payEpayStatus=0x0,payWechatStatus:payWechatStatus=0x0,payMpayStatus:payMpayStatus=0x0}=await this[_0x30e422(0x178)](['payHupiStatus',_0x30e422(0x135),_0x30e422(0x13b),_0x30e422(0x1af)]);if([payHupiStatus,payEpayStatus,payWechatStatus,payMpayStatus][_0x30e422(0x1ee)](_0x4ee88c=>_0x4ee88c===0x0))throw new common_1[(_0x30e422(0x189))](_0x30e422(0x147),common_1['HttpStatus']['BAD_REQUEST']);if(Number(payWechatStatus)===0x1)return _0x30e422(0x1d0);if(Number(payEpayStatus)===0x1)return _0x30e422(0x1de);if(Number(payMpayStatus)===0x1)return _0x30e422(0x18c);if(Number(payHupiStatus)===0x1)return _0x30e422(0x1d9);}async[_0x513b(0x17e)](){const _0x89b05c=_0x513b,{siteName:_0x5e92f8,qqNumber:_0x1dba35,vxNumber:_0x28f095,registerBaseUrl:_0x267a1d,domain:_0xc3bfe7}=await this['getConfigs']([_0x89b05c(0x131),_0x89b05c(0x149),_0x89b05c(0x1d8),_0x89b05c(0x176),_0x89b05c(0x12b)]);return{'siteName':_0x5e92f8,'qqNumber':_0x1dba35,'vxNumber':_0x28f095,'registerBaseUrl':_0x267a1d,'domain':_0xc3bfe7};}async[_0x513b(0x17b)](){const _0x4d07fa=_0x513b,{phoneRegisterStatus:_0x19919b,aliPhoneAccessKeyId:_0x211d60,aliPhoneAccessKeySecret:_0x530225,aliPhoneSignName:_0x49cc85,aliPhoneTemplateCode:_0x3baece}=await this['getConfigs']([_0x4d07fa(0x1f1),'aliPhoneAccessKeyId',_0x4d07fa(0x152),'aliPhoneSignName',_0x4d07fa(0x19f)]);if(Number(_0x19919b)!==0x1)throw new common_1[(_0x4d07fa(0x189))](_0x4d07fa(0x1cf),common_1['HttpStatus'][_0x4d07fa(0x184)]);return{'accessKeyId':_0x211d60,'accessKeySecret':_0x530225,'SignName':_0x49cc85,'TemplateCode':_0x3baece};}[_0x513b(0x1ae)](){const _0x2d4b9a=_0x513b;return process[_0x2d4b9a(0x139)][_0x2d4b9a(0x168)]||_0x2d4b9a(0x13e);}async[_0x513b(0x1b5)](){const _0x2097e9=_0x513b,{signInStatus:signInStatus=0x0,signInModel3Count:signInModel3Count=0x0,signInModel4Count:signInModel4Count=0x0,signInMjDrawToken:signInMjDrawToken=0x0}=await this[_0x2097e9(0x178)]([_0x2097e9(0x1b7),'signInModel3Count','signInModel4Count',_0x2097e9(0x1b4)]);if(Number(signInStatus)!==0x1)throw new common_1[(_0x2097e9(0x189))](_0x2097e9(0x1db),common_1[_0x2097e9(0x1ed)][_0x2097e9(0x184)]);return{'model3Count':Number(signInModel3Count),'model4Count':Number(signInModel4Count),'drawMjCount':Number(signInMjDrawToken)};}async[_0x513b(0x138)](){const _0x24e1a4=_0x513b,_0x295625='https://api.jiangly.com/api/permission/auth',_0x47b065=await fetch(_0x295625,{}),_0x49969a=await _0x47b065[_0x24e1a4(0x1c5)](),{success:success=!![],message:_0x4f067f}=_0x49969a;common_1[_0x24e1a4(0x1e1)][_0x24e1a4(0x190)](_0x24e1a4(0x1a9)),common_1[_0x24e1a4(0x1e1)]['error']('请填写您的授权码'),common_1[_0x24e1a4(0x1e1)][_0x24e1a4(0x190)](_0x24e1a4(0x1a3)),common_1[_0x24e1a4(0x1e1)][_0x24e1a4(0x190)](_0x24e1a4(0x1a3)),common_1['Logger'][_0x24e1a4(0x1e5)]('感谢您使用NineAi、祝您使用愉快~');}async[_0x513b(0x13f)](){const _0x2e98ab=_0x513b,{baiduTextStatus:baiduTextStatus=0x0,baiduTextAccessToken:_0x217b1b,nineaiBuiltInSensitiveStatus:nineaiBuiltInSensitiveStatus=0x0,nineaiBuiltInSensitiveApiBase:_0x51819b,nineaiBuiltInSensitiveAuthKey:_0x268700}=await this[_0x2e98ab(0x178)]([_0x2e98ab(0x1b6),_0x2e98ab(0x1a7),_0x2e98ab(0x14f),_0x2e98ab(0x133),_0x2e98ab(0x14e)]);if(Number(baiduTextStatus)===0x1)return{'useType':_0x2e98ab(0x191),'baiduTextAccessToken':_0x217b1b};if(Number(nineaiBuiltInSensitiveStatus)===0x1)return{'useType':_0x2e98ab(0x1e4),'nineaiBuiltInSensitiveApiBase':_0x51819b,'nineaiBuiltInSensitiveAuthKey':_0x268700};return null;}};GlobalConfigService=__decorate([(0x0,common_1[_0x513b(0x172)])(),__param(0x0,(0x0,typeorm_1[_0x513b(0x180)])(config_entity_1[_0x513b(0x161)])),__param(0x1,(0x0,typeorm_1['InjectRepository'])(chatLog_entity_1[_0x513b(0x1c4)])),__metadata(_0x513b(0x183),[typeorm_2['Repository'],typeorm_2[_0x513b(0x1ac)],models_service_1[_0x513b(0x16c)]])],GlobalConfigService),exports[_0x513b(0x18a)]=GlobalConfigService;