mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2025-09-26 13:16:39 +08:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
'use strict';function _0x10ba(_0x13ff22,_0x39e5bc){const _0x26730e=_0x2673();return _0x10ba=function(_0x10bac4,_0xe4f784){_0x10bac4=_0x10bac4-0x1c0;let _0x549d1b=_0x26730e[_0x10bac4];return _0x549d1b;},_0x10ba(_0x13ff22,_0x39e5bc);}function _0x2673(){const _0x209601=['public','join','getOwnPropertyDescriptor',']、初始密码为[','4URdynJ','metadata','805239273','Yi\x20Ai账号激活成功','buyCramiAddress','30VqgmIL','inviteGiveSendModel4Count','86346YtOVRR','log','firstRegisterSendStatus','checkSiteBaseConfig','insertId','registerVerifyEmailFrom','registerSendModel4Count','INSERT\x20INTO\x20config\x20(configKey,\x20configVal,\x20public,\x20encry)\x20VALUES\x20','query','https://api.openai.com','INTERNAL_SERVER_ERROR','bcryptjs','hashSync','decorate','Logger','3041ppBiro','registerSendStatus','INSERT\x20INTO\x20users\x20(username,\x20password,\x20status,\x20email,\x20role)\x20VALUES\x20(\x27','registerFailEmailTeamName','1800','registerSendDrawMjCount','design:paramtypes','qqNumber','admin','初始化创建','registerSuccessEmailTitle','inviteSendStatus','registerVerifyEmailDesc','createBaseSiteConfig',',请妥善保管您的账号,祝您使用愉快','registerSuccessEmailTeamName','Yi\x20Ai账号激活失败','count','HttpStatus','invitedGuestSendDrawMjCount','欢迎使用Yi\x20Ai团队的产品服务,请在五分钟内完成你的账号激活,点击以下按钮激活您的账号,','初始化网站配置信息成功、如您需要修改网站配置信息,请前往管理系统系统配置设置\x20==============>\x20请注意查阅','baiduToken','registerVerifyExpir','Injectable','@nestjs/common','\x27,\x200,\x201000,\x20100)','1191722YALMth','SELECT\x20*\x20FROM\x20users\x20WHERE\x20role\x20=\x20\x27super\x27','onModuleInit','createDefaultUser','149424YjwSwJ','Yi\x20Ai团队','openaiBaseUrl','error:\x20','6381GLqJth','vxNumber','Connection','typeorm','function','Yi\x20Ai团队账号验证','\x27,\x20\x27',']\x20==============>\x20请注意查阅','siteName','isVerifyEmail','DatabaseService','connection','__metadata','firstRregisterSendModel3Count','baiduSiteId','nine-super','defaultAdmin@cooper.com','super','object','encry','\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','registerVerifyEmailTitle','map','__esModule','Yi\x20Ai','1275240FGfKKE','创建默认网站配置失败!','checkSuperAdmin','length','registerSuccessEmaileAppend','robotAvatar','HttpException','inviteGiveSendModel3Count','inviteGiveSendDrawMjCount','558850xVAFwn','123456','configVal','\x0a\x20\x20SELECT\x20COUNT(*)\x20AS\x20count\x20FROM\x20config\x20WHERE\x20`configKey`\x20IN\x20(','firstRregisterSendDrawMjCount','__decorate','configKey'];_0x2673=function(){return _0x209601;};return _0x2673();}const _0x23f878=_0x10ba;(function(_0x1a1b95,_0x30f737){const _0x159550=_0x10ba,_0x34bfe4=_0x1a1b95();while(!![]){try{const _0x1dbc7b=parseInt(_0x159550(0x224))/0x1*(-parseInt(_0x159550(0x213))/0x2)+parseInt(_0x159550(0x1e1))/0x3+-parseInt(_0x159550(0x20e))/0x4*(parseInt(_0x159550(0x203))/0x5)+-parseInt(_0x159550(0x1dd))/0x6+parseInt(_0x159550(0x1d9))/0x7+parseInt(_0x159550(0x1fa))/0x8+-parseInt(_0x159550(0x215))/0x9;if(_0x1dbc7b===_0x30f737)break;else _0x34bfe4['push'](_0x34bfe4['shift']());}catch(_0x4ba3cf){_0x34bfe4['push'](_0x34bfe4['shift']());}}}(_0x2673,0x22277));var __decorate=this&&this[_0x23f878(0x208)]||function(_0xda91d6,_0x51f1b3,_0x55fffc,_0x31edaf){const _0x11bea3=_0x23f878;var _0x2c9737=arguments[_0x11bea3(0x1fd)],_0x48e950=_0x2c9737<0x3?_0x51f1b3:_0x31edaf===null?_0x31edaf=Object[_0x11bea3(0x20c)](_0x51f1b3,_0x55fffc):_0x31edaf,_0x4e3b3f;if(typeof Reflect===_0x11bea3(0x1f3)&&typeof Reflect['decorate']===_0x11bea3(0x1e5))_0x48e950=Reflect[_0x11bea3(0x222)](_0xda91d6,_0x51f1b3,_0x55fffc,_0x31edaf);else{for(var _0x184782=_0xda91d6['length']-0x1;_0x184782>=0x0;_0x184782--)if(_0x4e3b3f=_0xda91d6[_0x184782])_0x48e950=(_0x2c9737<0x3?_0x4e3b3f(_0x48e950):_0x2c9737>0x3?_0x4e3b3f(_0x51f1b3,_0x55fffc,_0x48e950):_0x4e3b3f(_0x51f1b3,_0x55fffc))||_0x48e950;}return _0x2c9737>0x3&&_0x48e950&&Object['defineProperty'](_0x51f1b3,_0x55fffc,_0x48e950),_0x48e950;},__metadata=this&&this[_0x23f878(0x1ed)]||function(_0x125664,_0x44bf8c){const _0x41fdb9=_0x23f878;if(typeof Reflect===_0x41fdb9(0x1f3)&&typeof Reflect[_0x41fdb9(0x20f)]==='function')return Reflect['metadata'](_0x125664,_0x44bf8c);};Object['defineProperty'](exports,_0x23f878(0x1f8),{'value':!![]}),exports[_0x23f878(0x1eb)]=void 0x0;const common_1=require(_0x23f878(0x1d7)),typeorm_1=require(_0x23f878(0x1e4)),bcrypt=require(_0x23f878(0x220));let DatabaseService=class DatabaseService{constructor(_0x1191dd){const _0x539332=_0x23f878;this[_0x539332(0x1ec)]=_0x1191dd;}async[_0x23f878(0x1db)](){const _0x4e5ceb=_0x23f878;await this[_0x4e5ceb(0x1fc)](),await this[_0x4e5ceb(0x218)]();}async[_0x23f878(0x1fc)](){const _0xb2e0de=_0x23f878,_0x27a4bd=await this[_0xb2e0de(0x1ec)][_0xb2e0de(0x21d)](_0xb2e0de(0x1da));if(!_0x27a4bd||_0x27a4bd[_0xb2e0de(0x1fd)]===0x0){const _0x4514ff=bcrypt['hashSync'](_0xb2e0de(0x204),0xa),_0x22e3da=bcrypt[_0xb2e0de(0x221)](_0xb2e0de(0x204),0xa),_0x5c3bd4='default@cooper.com',_0x2b2c46=_0xb2e0de(0x1f1),_0x19bf54={'username':_0xb2e0de(0x1f2),'password':_0x4514ff,'status':0x1,'email':_0x5c3bd4,'sex':0x1,'role':_0xb2e0de(0x1f2)},_0x52f646={'username':_0xb2e0de(0x1c6),'password':_0x22e3da,'status':0x1,'email':_0x2b2c46,'sex':0x1,'role':_0xb2e0de(0x1c6)};await this['createDefaultUser'](_0x19bf54),await this['createDefaultUser'](_0x52f646);}}async[_0x23f878(0x1dc)](_0xa639f6){const _0x2b40e5=_0x23f878;try{const {username:_0x20ad34,password:_0x11ec3f,status:_0x587672,email:_0x32cbdc,role:_0x2511d2}=_0xa639f6,_0x3b7a95=await this[_0x2b40e5(0x1ec)][_0x2b40e5(0x21d)](_0x2b40e5(0x1c0)+_0x20ad34+_0x2b40e5(0x1e7)+_0x11ec3f+'\x27,\x20\x27'+_0x587672+_0x2b40e5(0x1e7)+_0x32cbdc+_0x2b40e5(0x1e7)+_0x2511d2+'\x27)'),_0x30aeff=_0x3b7a95[_0x2b40e5(0x219)],_0x2a6a8a=await this[_0x2b40e5(0x1ec)][_0x2b40e5(0x21d)]('INSERT\x20INTO\x20balance\x20(userId,\x20balance,\x20usesLeft,\x20paintCount)\x20VALUES\x20(\x27'+_0x30aeff+_0x2b40e5(0x1d8));common_1[_0x2b40e5(0x223)][_0x2b40e5(0x216)](_0x2b40e5(0x1c7)+_0x2511d2+'用户成功、用户名为['+_0x20ad34+_0x2b40e5(0x20d)+(_0x20ad34==='super'?_0x2b40e5(0x1f0):_0x2b40e5(0x204))+_0x2b40e5(0x1e8),'DatabaseService');}catch(_0x3b0ec5){console[_0x2b40e5(0x216)]('error:\x20',_0x3b0ec5);throw new common_1[(_0x2b40e5(0x200))]('创建默认超级管理员失败!',common_1[_0x2b40e5(0x1d0)][_0x2b40e5(0x21f)]);}}async[_0x23f878(0x218)](){const _0x485d31=_0x23f878,_0x16ca7e=[_0x485d31(0x1e9),_0x485d31(0x1c5),_0x485d31(0x1e2),'robotAvatar','userDefautlAvatar'],_0x596316=await this['connection'][_0x485d31(0x21d)](_0x485d31(0x206)+_0x16ca7e[_0x485d31(0x1f7)](_0x5082ef=>'\x27'+_0x5082ef+'\x27')[_0x485d31(0x20b)](',')+')\x0a'),_0x437a99=parseInt(_0x596316[0x0][_0x485d31(0x1cf)]);_0x437a99===0x0&&await this[_0x485d31(0x1cb)]();}async['createBaseSiteConfig'](){const _0x29cbb1=_0x23f878;try{const _0x1567e4='',_0x54f812=_0x29cbb1(0x1f5),_0x5a8945=[{'configKey':_0x29cbb1(0x1e9),'configVal':_0x29cbb1(0x1f9),'public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1c5),'configVal':_0x29cbb1(0x210),'public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1e2),'configVal':'HelloWordYi819','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1ff),'configVal':'','public':0x1,'encry':0x0},{'configKey':'userDefautlAvatar','configVal':'','public':0x0,'encry':0x0},{'configKey':'baiduCode','configVal':_0x1567e4,'public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1ef),'configVal':'','public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x1d4),'configVal':'','public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x212),'configVal':'','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1df),'configVal':_0x29cbb1(0x21e),'public':0x0,'encry':0x0},{'configKey':'noticeInfo','configVal':_0x54f812,'public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1f6),'configVal':_0x29cbb1(0x1e6),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x1ca),'configVal':_0x29cbb1(0x1d2),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x21a),'configVal':_0x29cbb1(0x1de),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x1d5),'configVal':_0x29cbb1(0x1c2),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x1c8),'configVal':_0x29cbb1(0x211),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x1cd),'configVal':_0x29cbb1(0x1f9),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x1fe),'configVal':_0x29cbb1(0x1cc),'public':0x0,'encry':0x0},{'configKey':'registerFailEmailTitle','configVal':_0x29cbb1(0x1ce),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x1c1),'configVal':_0x29cbb1(0x1de),'public':0x0,'encry':0x0},{'configKey':_0x29cbb1(0x225),'configVal':'1','public':0x1,'encry':0x0},{'configKey':'registerSendModel3Count','configVal':'30','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x21b),'configVal':'3','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1c3),'configVal':'3','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x217),'configVal':'1','public':0x1,'encry':0x0},{'configKey':'firstRegisterSendRank','configVal':'500','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1ee),'configVal':'10','public':0x1,'encry':0x0},{'configKey':'firstRregisterSendModel4Count','configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x207),'configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1c9),'configVal':'1','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x201),'configVal':'0','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x214),'configVal':'0','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x202),'configVal':'0','public':0x1,'encry':0x0},{'configKey':'invitedGuestSendModel3Count','configVal':'10','public':0x1,'encry':0x0},{'configKey':'invitedGuestSendModel4Count','configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1d1),'configVal':'10','public':0x1,'encry':0x0},{'configKey':_0x29cbb1(0x1ea),'configVal':'1','public':0x1,'encry':0x0}],_0x5f5733=await this['connection'][_0x29cbb1(0x21d)](_0x29cbb1(0x21c)+_0x5a8945[_0x29cbb1(0x1f7)](_0x215e8a=>'(\x27'+_0x215e8a[_0x29cbb1(0x209)]+_0x29cbb1(0x1e7)+_0x215e8a[_0x29cbb1(0x205)]['replace'](/'/g,'\x5c\x27')+_0x29cbb1(0x1e7)+_0x215e8a[_0x29cbb1(0x20a)]+_0x29cbb1(0x1e7)+_0x215e8a[_0x29cbb1(0x1f4)]+'\x27)')[_0x29cbb1(0x20b)](',\x20'));common_1[_0x29cbb1(0x223)][_0x29cbb1(0x216)](_0x29cbb1(0x1d3),'DatabaseService');}catch(_0x1fae8e){console['log'](_0x29cbb1(0x1e0),_0x1fae8e);throw new common_1['HttpException'](_0x29cbb1(0x1fb),common_1[_0x29cbb1(0x1d0)][_0x29cbb1(0x21f)]);}}};DatabaseService=__decorate([(0x0,common_1[_0x23f878(0x1d6)])(),__metadata(_0x23f878(0x1c4),[typeorm_1[_0x23f878(0x1e3)]])],DatabaseService),exports[_0x23f878(0x1eb)]=DatabaseService; |