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

1 line
11 KiB
JavaScript

'use strict';function _0x1bba(){const _0x424934=['firstRregisterSendModel4Count','INSERT\x20INTO\x20config\x20(configKey,\x20configVal,\x20public,\x20encry)\x20VALUES\x20','18174460KurOQl','firstRregisterSendDrawMjCount','invitedGuestSendDrawMjCount','firstRregisterSendModel3Count','registerVerifyExpir','INSERT\x20INTO\x20balance\x20(userId,\x20balance,\x20usesLeft,\x20paintCount)\x20VALUES\x20(\x27','super','123456','Yi\x20Ai','openaiBaseUrl','baiduCode','https://api.openai.com','2984931jHjNvM','registerSuccessEmailTeamName','375728bYjLki','Yi\x20Ai账号激活失败','__decorate','query',']、初始密码为[','6362406pNUupq','default@cooper.com','创建默认超级管理员失败!','decorate','创建默认网站配置失败!','vxNumber','inviteSendStatus','registerSendDrawMjCount','inviteGiveSendModel3Count','\x27,\x200,\x201000,\x20100)','@nestjs/common','admin','registerFailEmailTitle','insertId','7WhxdLn','785825yfhBTe','DatabaseService','error:\x20','count','configKey','join','createDefaultUser','noticeInfo','getOwnPropertyDescriptor','30YmQVkS','初始化创建','registerSendModel4Count','用户成功、用户名为[','inviteGiveSendDrawMjCount','HttpException','siteName','onModuleInit','22EkZulK','Injectable','HelloWordYi819','欢迎使用Yi\x20Ai团队的产品服务,请在五分钟内完成你的账号激活,点击以下按钮激活您的账号,','replace','Yi\x20Ai团队账号验证','\x0a\x20\x20SELECT\x20COUNT(*)\x20AS\x20count\x20FROM\x20config\x20WHERE\x20`configKey`\x20IN\x20(','public','registerVerifyEmailDesc','invitedGuestSendModel4Count','\x0a####\x20YiAi\x20欢迎您\x0a\x20-\x20欢迎使用YiAi\x0a\x20-\x20初始管理员账号密码\x20\x20super\x20\x20123456\x20【前台后台登录都可以修改】\x0a\x20-\x20初始预览账号密码\x20\x20admin\x20\x20123456\x20【为后台查看账号\x20仅可查看部分非敏感数据】\x0a','firstRegisterSendRank','500','2qGJrnu','metadata','robotAvatar','__metadata','encry','Yi\x20Ai账号激活成功','userDefautlAvatar','isVerifyEmail','object','HttpStatus','defineProperty','baiduSiteId','registerVerifyEmailTitle','length','buyCramiAddress','INSERT\x20INTO\x20users\x20(username,\x20password,\x20status,\x20email,\x20role)\x20VALUES\x20(\x27','nine-super','createBaseSiteConfig','connection','qqNumber','1004261rmugRx','Yi\x20Ai团队','log','baiduToken','\x27,\x20\x27','configVal','SELECT\x20*\x20FROM\x20users\x20WHERE\x20role\x20=\x20\x27super\x27','defaultAdmin@cooper.com','firstRegisterSendStatus','map','registerSuccessEmaileAppend','805239273','2409212yfqEqM',',请妥善保管您的账号,祝您使用愉快'];_0x1bba=function(){return _0x424934;};return _0x1bba();}const _0x33accf=_0xc7d1;(function(_0x50893e,_0x1e0eb8){const _0x8a5114=_0xc7d1,_0x4835bd=_0x50893e();while(!![]){try{const _0x286936=parseInt(_0x8a5114(0x22f))/0x1*(parseInt(_0x8a5114(0x21b))/0x2)+parseInt(_0x8a5114(0x1e7))/0x3+parseInt(_0x8a5114(0x1d7))/0x4+parseInt(_0x8a5114(0x1fd))/0x5*(parseInt(_0x8a5114(0x206))/0x6)+-parseInt(_0x8a5114(0x1fc))/0x7*(-parseInt(_0x8a5114(0x1e9))/0x8)+parseInt(_0x8a5114(0x1ee))/0x9+parseInt(_0x8a5114(0x1db))/0xa*(-parseInt(_0x8a5114(0x20e))/0xb);if(_0x286936===_0x1e0eb8)break;else _0x4835bd['push'](_0x4835bd['shift']());}catch(_0x54dd80){_0x4835bd['push'](_0x4835bd['shift']());}}}(_0x1bba,0x7ba06));function _0xc7d1(_0x3f8ae6,_0x349f5e){const _0x1bba75=_0x1bba();return _0xc7d1=function(_0xc7d176,_0xe3fd44){_0xc7d176=_0xc7d176-0x1cc;let _0x3f8d8f=_0x1bba75[_0xc7d176];return _0x3f8d8f;},_0xc7d1(_0x3f8ae6,_0x349f5e);}var __decorate=this&&this[_0x33accf(0x1eb)]||function(_0xf37169,_0x2143ed,_0x56fe19,_0x1dc181){const _0x137acc=_0x33accf;var _0xb0e7ab=arguments[_0x137acc(0x228)],_0x1ff66f=_0xb0e7ab<0x3?_0x2143ed:_0x1dc181===null?_0x1dc181=Object[_0x137acc(0x205)](_0x2143ed,_0x56fe19):_0x1dc181,_0x3218da;if(typeof Reflect===_0x137acc(0x223)&&typeof Reflect[_0x137acc(0x1f1)]==='function')_0x1ff66f=Reflect[_0x137acc(0x1f1)](_0xf37169,_0x2143ed,_0x56fe19,_0x1dc181);else{for(var _0x1a77c1=_0xf37169[_0x137acc(0x228)]-0x1;_0x1a77c1>=0x0;_0x1a77c1--)if(_0x3218da=_0xf37169[_0x1a77c1])_0x1ff66f=(_0xb0e7ab<0x3?_0x3218da(_0x1ff66f):_0xb0e7ab>0x3?_0x3218da(_0x2143ed,_0x56fe19,_0x1ff66f):_0x3218da(_0x2143ed,_0x56fe19))||_0x1ff66f;}return _0xb0e7ab>0x3&&_0x1ff66f&&Object[_0x137acc(0x225)](_0x2143ed,_0x56fe19,_0x1ff66f),_0x1ff66f;},__metadata=this&&this[_0x33accf(0x21e)]||function(_0xeb73bc,_0x58eb8d){const _0x28b59a=_0x33accf;if(typeof Reflect===_0x28b59a(0x223)&&typeof Reflect[_0x28b59a(0x21c)]==='function')return Reflect['metadata'](_0xeb73bc,_0x58eb8d);};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['DatabaseService']=void 0x0;const common_1=require(_0x33accf(0x1f8)),typeorm_1=require('typeorm'),bcrypt=require('bcryptjs');let DatabaseService=class DatabaseService{constructor(_0x31e4ce){const _0x5d535c=_0x33accf;this[_0x5d535c(0x22d)]=_0x31e4ce;}async[_0x33accf(0x20d)](){await this['checkSuperAdmin'](),await this['checkSiteBaseConfig']();}async['checkSuperAdmin'](){const _0x17a288=_0x33accf,_0x4b9b00=await this['connection'][_0x17a288(0x1ec)](_0x17a288(0x1d1));if(!_0x4b9b00||_0x4b9b00['length']===0x0){const _0x1cdc82=bcrypt['hashSync'](_0x17a288(0x1e2),0xa),_0x50e7ee=bcrypt['hashSync'](_0x17a288(0x1e2),0xa),_0x10310a=_0x17a288(0x1ef),_0x298088=_0x17a288(0x1d2),_0x3a6456={'username':_0x17a288(0x1e1),'password':_0x1cdc82,'status':0x1,'email':_0x10310a,'sex':0x1,'role':_0x17a288(0x1e1)},_0x18daf1={'username':_0x17a288(0x1f9),'password':_0x50e7ee,'status':0x1,'email':_0x298088,'sex':0x1,'role':_0x17a288(0x1f9)};await this[_0x17a288(0x203)](_0x3a6456),await this[_0x17a288(0x203)](_0x18daf1);}}async[_0x33accf(0x203)](_0x5c7031){const _0x2a750e=_0x33accf;try{const {username:_0xb5e269,password:_0x39bc0d,status:_0x4c7987,email:_0x15eb8d,role:_0x1b96da}=_0x5c7031,_0x1e9ffc=await this['connection']['query'](_0x2a750e(0x22a)+_0xb5e269+_0x2a750e(0x1cf)+_0x39bc0d+_0x2a750e(0x1cf)+_0x4c7987+_0x2a750e(0x1cf)+_0x15eb8d+'\x27,\x20\x27'+_0x1b96da+'\x27)'),_0x3bf3e6=_0x1e9ffc[_0x2a750e(0x1fb)],_0x42a969=await this[_0x2a750e(0x22d)][_0x2a750e(0x1ec)](_0x2a750e(0x1e0)+_0x3bf3e6+_0x2a750e(0x1f7));common_1['Logger'][_0x2a750e(0x1cd)](_0x2a750e(0x207)+_0x1b96da+_0x2a750e(0x209)+_0xb5e269+_0x2a750e(0x1ed)+(_0xb5e269===_0x2a750e(0x1e1)?_0x2a750e(0x22b):_0x2a750e(0x1e2))+']\x20==============>\x20请注意查阅','DatabaseService');}catch(_0x359a6e){console[_0x2a750e(0x1cd)](_0x2a750e(0x1ff),_0x359a6e);throw new common_1[(_0x2a750e(0x20b))](_0x2a750e(0x1f0),common_1[_0x2a750e(0x224)]['INTERNAL_SERVER_ERROR']);}}async['checkSiteBaseConfig'](){const _0x401d60=_0x33accf,_0x4ce3e3=[_0x401d60(0x20c),_0x401d60(0x22e),_0x401d60(0x1f3),_0x401d60(0x21d),'userDefautlAvatar'],_0x8fc1ee=await this[_0x401d60(0x22d)][_0x401d60(0x1ec)](_0x401d60(0x214)+_0x4ce3e3[_0x401d60(0x1d4)](_0x9ee6d8=>'\x27'+_0x9ee6d8+'\x27')[_0x401d60(0x202)](',')+')\x0a'),_0x47eec6=parseInt(_0x8fc1ee[0x0][_0x401d60(0x200)]);_0x47eec6===0x0&&await this[_0x401d60(0x22c)]();}async[_0x33accf(0x22c)](){const _0x2b2cff=_0x33accf;try{const _0x39aee4='',_0x4eadf9=_0x2b2cff(0x218),_0xa20f56=[{'configKey':_0x2b2cff(0x20c),'configVal':_0x2b2cff(0x1e3),'public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x22e),'configVal':_0x2b2cff(0x1d6),'public':0x1,'encry':0x0},{'configKey':'vxNumber','configVal':_0x2b2cff(0x210),'public':0x1,'encry':0x0},{'configKey':'robotAvatar','configVal':'','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x221),'configVal':'','public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x1e5),'configVal':_0x39aee4,'public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x226),'configVal':'','public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x1ce),'configVal':'','public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x229),'configVal':'','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1e4),'configVal':_0x2b2cff(0x1e6),'public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x204),'configVal':_0x4eadf9,'public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x227),'configVal':_0x2b2cff(0x213),'public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x216),'configVal':_0x2b2cff(0x211),'public':0x0,'encry':0x0},{'configKey':'registerVerifyEmailFrom','configVal':'Yi\x20Ai团队','public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x1df),'configVal':'1800','public':0x0,'encry':0x0},{'configKey':'registerSuccessEmailTitle','configVal':_0x2b2cff(0x220),'public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x1e8),'configVal':_0x2b2cff(0x1e3),'public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x1d5),'configVal':_0x2b2cff(0x1d8),'public':0x0,'encry':0x0},{'configKey':_0x2b2cff(0x1fa),'configVal':_0x2b2cff(0x1ea),'public':0x0,'encry':0x0},{'configKey':'registerFailEmailTeamName','configVal':_0x2b2cff(0x1cc),'public':0x0,'encry':0x0},{'configKey':'registerSendStatus','configVal':'1','public':0x1,'encry':0x0},{'configKey':'registerSendModel3Count','configVal':'30','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x208),'configVal':'3','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1f5),'configVal':'3','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1d3),'configVal':'1','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x219),'configVal':_0x2b2cff(0x21a),'public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1de),'configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1d9),'configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1dc),'configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1f4),'configVal':'1','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1f6),'configVal':'0','public':0x1,'encry':0x0},{'configKey':'inviteGiveSendModel4Count','configVal':'0','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x20a),'configVal':'0','public':0x1,'encry':0x0},{'configKey':'invitedGuestSendModel3Count','configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x217),'configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x1dd),'configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x2b2cff(0x222),'configVal':'1','public':0x1,'encry':0x0}],_0x31f6a4=await this['connection'][_0x2b2cff(0x1ec)](_0x2b2cff(0x1da)+_0xa20f56['map'](_0x2deb8e=>'(\x27'+_0x2deb8e[_0x2b2cff(0x201)]+_0x2b2cff(0x1cf)+_0x2deb8e[_0x2b2cff(0x1d0)][_0x2b2cff(0x212)](/'/g,'\x5c\x27')+_0x2b2cff(0x1cf)+_0x2deb8e[_0x2b2cff(0x215)]+'\x27,\x20\x27'+_0x2deb8e[_0x2b2cff(0x21f)]+'\x27)')[_0x2b2cff(0x202)](',\x20'));common_1['Logger'][_0x2b2cff(0x1cd)]('初始化网站配置信息成功、如您需要修改网站配置信息,请前往管理系统系统配置设置\x20==============>\x20请注意查阅','DatabaseService');}catch(_0x51d515){console[_0x2b2cff(0x1cd)](_0x2b2cff(0x1ff),_0x51d515);throw new common_1[(_0x2b2cff(0x20b))](_0x2b2cff(0x1f2),common_1[_0x2b2cff(0x224)]['INTERNAL_SERVER_ERROR']);}}};DatabaseService=__decorate([(0x0,common_1[_0x33accf(0x20f)])(),__metadata('design:paramtypes',[typeorm_1['Connection']])],DatabaseService),exports[_0x33accf(0x1fe)]=DatabaseService;