mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2025-09-27 05:36:40 +08:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
'use strict';const _0x5847ba=_0x5b86;(function(_0x35679a,_0x335163){const _0x481ad4=_0x5b86,_0x549a31=_0x35679a();while(!![]){try{const _0x274e4=-parseInt(_0x481ad4(0x118))/0x1+-parseInt(_0x481ad4(0xf4))/0x2*(-parseInt(_0x481ad4(0xec))/0x3)+-parseInt(_0x481ad4(0x109))/0x4*(-parseInt(_0x481ad4(0x115))/0x5)+-parseInt(_0x481ad4(0xdd))/0x6*(-parseInt(_0x481ad4(0x134))/0x7)+-parseInt(_0x481ad4(0x12b))/0x8*(-parseInt(_0x481ad4(0x114))/0x9)+-parseInt(_0x481ad4(0x141))/0xa*(parseInt(_0x481ad4(0x13f))/0xb)+-parseInt(_0x481ad4(0x124))/0xc;if(_0x274e4===_0x335163)break;else _0x549a31['push'](_0x549a31['shift']());}catch(_0xb2a545){_0x549a31['push'](_0x549a31['shift']());}}}(_0x178a,0x7e6e9));function _0x178a(){const _0x53c760=['getTime','AuthService','__decorate','userService','104496yIHJzC','loginByCode','jiangly','来自公众号的回复问题\x20=======>\x20超时导致问题无法回答完整','__esModule','getConfigs','jsapi_ticket=','由于公众号的回复限制、过长的问题我们可能无法回复、您可以前往我们的官方站点享受更加完善的服务、如果您有更多问题、欢迎像我提问!','split','authService','verify','object','wechatOfficialAppSecret','race','tousername','168186zkBUxV','log','genXmlMsgByConfig','scanBindWx','fetchQRCodeTicket','https://api.weixin.qq.com/sns/oauth2/access_token?appid=','wechatJsapiTicket','getOwnPropertyDescriptor','16jQYvJu','function','GlobalConfigService','AutoreplyService','../globalConfig/globalConfig.service','loginByOpenId','ChatgptService','&secret=','getWechatAccessToken','×tamp=','getQRSceneStrByBind','createHash','wechatAccessToken','HttpStatus','str:\x20','loginBySceneStr','createRandomNonceStr','autoreplyService','scanedSceneStrMap','metadata','@nestjs/common','56rIbMxM','getUserFromOpenId','__metadata','chatgptService','wechatOfficialAppId','default','请求超时','jsapiTicket:\x20','&noncestr=','onModuleInit','../user/user.service','9oYwMia','361565aociob',']]></FromUserName>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<CreateTime>','chatSyncFree','183347LbtVXM','sceneStrMap','wechatOfficialToken','defineProperty','../chatgpt/chatgpt.service','globalConfigService','UserService','aotoPlay','来自公众号的询问问题\x20=======>\x20','hex','bindWx','axios','19693920RJocuj','checkAutoReply','join','&response_type=code&scope=snsapi_base&state=weChatLogin#wechat_redirect','&url=','genXmlMsg','QR_STR_SCENE','7738816otdNwv','</CreateTime>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<MsgType><![CDATA[text]]></MsgType>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<Content><![CDATA[','https://open.weixin.qq.com/connect/oauth2/authorize?appid=','scan','getRedirectUrl','fromusername','OfficialService','post','decorate','175SHtDVh','getUserOpenId','非法参数','design:paramtypes','length','digest','sort',']]></ToUserName>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<FromUserName><![CDATA[','officialAutoReplyText','&redirect_uri=','HttpException','5733838JElPNK','crypto','10EFGaJj','sha1','&grant_type=authorization_code','https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=','BAD_REQUEST','getQRCodeTicket'];_0x178a=function(){return _0x53c760;};return _0x178a();}var __decorate=this&&this[_0x5847ba(0xdb)]||function(_0x271f96,_0x36b969,_0x508bce,_0x422d39){const _0x137b70=_0x5847ba;var _0x41df76=arguments[_0x137b70(0x138)],_0x2ae6ea=_0x41df76<0x3?_0x36b969:_0x422d39===null?_0x422d39=Object[_0x137b70(0xf3)](_0x36b969,_0x508bce):_0x422d39,_0x10001a;if(typeof Reflect===_0x137b70(0xe8)&&typeof Reflect[_0x137b70(0x133)]==='function')_0x2ae6ea=Reflect['decorate'](_0x271f96,_0x36b969,_0x508bce,_0x422d39);else{for(var _0x564a66=_0x271f96[_0x137b70(0x138)]-0x1;_0x564a66>=0x0;_0x564a66--)if(_0x10001a=_0x271f96[_0x564a66])_0x2ae6ea=(_0x41df76<0x3?_0x10001a(_0x2ae6ea):_0x41df76>0x3?_0x10001a(_0x36b969,_0x508bce,_0x2ae6ea):_0x10001a(_0x36b969,_0x508bce))||_0x2ae6ea;}return _0x41df76>0x3&&_0x2ae6ea&&Object['defineProperty'](_0x36b969,_0x508bce,_0x2ae6ea),_0x2ae6ea;},__metadata=this&&this[_0x5847ba(0x10b)]||function(_0x497dcb,_0x53b50f){const _0x127c4d=_0x5847ba;if(typeof Reflect==='object'&&typeof Reflect[_0x127c4d(0x107)]===_0x127c4d(0xf5))return Reflect[_0x127c4d(0x107)](_0x497dcb,_0x53b50f);};function _0x5b86(_0x3ff775,_0xfeb2d0){const _0x178ab6=_0x178a();return _0x5b86=function(_0x5b8620,_0x50687a){_0x5b8620=_0x5b8620-0xdb;let _0x5b59c1=_0x178ab6[_0x5b8620];return _0x5b59c1;},_0x5b86(_0x3ff775,_0xfeb2d0);}Object[_0x5847ba(0x11b)](exports,_0x5847ba(0xe1),{'value':!![]}),exports[_0x5847ba(0x131)]=void 0x0;const chatgpt_service_1=require(_0x5847ba(0x11c)),globalConfig_service_1=require(_0x5847ba(0xf8)),auth_service_1=require('../auth/auth.service'),user_service_1=require(_0x5847ba(0x113)),autoreply_service_1=require('../autoreply/autoreply.service'),common_1=require(_0x5847ba(0x108)),crypto=require(_0x5847ba(0x140)),axios_1=require(_0x5847ba(0x123)),utils_1=require('../../common/utils');let OfficialService=class OfficialService{constructor(_0x1b9edf,_0x4aa8e2,_0xbe59fa,_0xf3d169,_0x14f032){const _0x375525=_0x5847ba;this[_0x375525(0x105)]=_0x1b9edf,this[_0x375525(0xdc)]=_0x4aa8e2,this[_0x375525(0xe6)]=_0xbe59fa,this[_0x375525(0x11d)]=_0xf3d169,this[_0x375525(0x10c)]=_0x14f032,this[_0x375525(0x119)]={},this[_0x375525(0x106)]={};}async[_0x5847ba(0x112)](){const _0x23b694=_0x5847ba;await this['globalConfigService'][_0x23b694(0xfc)](!![]);}async['getQRSceneStr'](_0x264de8){const _0x5c69e0=_0x5847ba,{invitedBy:_0x50d417}=_0x264de8;let _0x49b9c8=(0x0,utils_1[_0x5c69e0(0x104)])(0x20);return _0x50d417&&(_0x49b9c8+=':'+_0x50d417),this['sceneStrMap'][_0x49b9c8]=!![],_0x49b9c8;}async[_0x5847ba(0xfe)](_0x4b13c9){const _0x23d874=_0x5847ba,{id:_0x307333}=_0x4b13c9['user'],_0x22fd3c=(0x0,utils_1[_0x23d874(0x104)])(0x20)+'/'+_0x307333;return this[_0x23d874(0x119)][_0x22fd3c]=!![],_0x22fd3c;}async[_0x5847ba(0x146)](_0x8f93fe){return this['fetchQRCodeTicket'](_0x8f93fe);}async[_0x5847ba(0x12f)](_0x464075){const _0x562b53=_0x5847ba,_0x5121b6=await this[_0x562b53(0x11d)][_0x562b53(0xe2)]([_0x562b53(0x10d)]),_0x214a66=_0x562b53(0x12d)+_0x5121b6+_0x562b53(0x13d)+encodeURIComponent(_0x464075)+_0x562b53(0x127);return console['log']('回跳跳转地址:\x20',_0x214a66),_0x214a66;}async['getJsapiTicket'](_0x232a30){const _0x39bf90=_0x5847ba,_0x2ae3e4=(0x0,utils_1['createRandomNonceStr'])(0x20),_0x54dfb0=(Date['now']()/0x3e8)['toFixed'](0x0),_0x25de6f=await this[_0x39bf90(0x11d)][_0x39bf90(0xe2)]([_0x39bf90(0xf2)]);console[_0x39bf90(0xed)](_0x39bf90(0x110),_0x25de6f);const _0x14a50f=await this[_0x39bf90(0x11d)][_0x39bf90(0xe2)](['wechatOfficialAppId']);console['log']('appId:\x20',_0x14a50f);const _0x27b1a2=_0x39bf90(0xe3)+_0x25de6f+_0x39bf90(0x111)+_0x2ae3e4+_0x39bf90(0xfd)+_0x54dfb0+_0x39bf90(0x128)+_0x232a30;console[_0x39bf90(0xed)](_0x39bf90(0x102),_0x27b1a2);const _0x3ff7c5=this['sha1'](_0x27b1a2);return{'appId':_0x14a50f,'nonceStr':_0x2ae3e4,'timestamp':_0x54dfb0,'signature':_0x3ff7c5};}async[_0x5847ba(0xf0)](_0x18b634){const _0x34b247=_0x5847ba,_0x5c5dce=await this[_0x34b247(0x11d)][_0x34b247(0xe2)]([_0x34b247(0x100)]),_0x27c4fb={'action_name':_0x34b247(0x12a),'action_info':{'scene':{'scene_str':_0x18b634}}},_0x29b65e=await axios_1[_0x34b247(0x10e)][_0x34b247(0x132)](_0x34b247(0x144)+_0x5c5dce,_0x27c4fb),{data:{errmsg:_0x2e3534,ticket:_0x305a8b}}=_0x29b65e;if(_0x2e3534)throw new common_1[(_0x34b247(0x13e))](_0x2e3534,common_1[_0x34b247(0x101)][_0x34b247(0x145)]);return _0x305a8b;}async[_0x5847ba(0xde)](_0x3ea600,_0x16e1c2){const _0x386f77=_0x5847ba,_0x49248c=await this[_0x386f77(0x11d)]['getConfigs']([_0x386f77(0x10d)]),_0xe80cc0=await this['globalConfigService'][_0x386f77(0xe2)]([_0x386f77(0xe9)]),_0xfd5e53=await axios_1[_0x386f77(0x10e)]['get'](_0x386f77(0xf1)+_0x49248c+_0x386f77(0xfb)+_0xe80cc0+'&code='+_0x16e1c2+_0x386f77(0x143)),{data:{errmsg:_0x67d6e2,openid:_0x105702}}=_0xfd5e53;if(_0x67d6e2)throw new common_1[(_0x386f77(0x13e))](_0x67d6e2,common_1[_0x386f77(0x101)][_0x386f77(0x145)]);let _0x4b28bb;return _0x4b28bb=await this[_0x386f77(0xdc)][_0x386f77(0x135)](_0x105702),!_0x4b28bb&&(_0x4b28bb=await this[_0x386f77(0xdc)][_0x386f77(0x10a)](_0x105702)),this['authService'][_0x386f77(0xf9)](_0x4b28bb,_0x3ea600);}async[_0x5847ba(0x12e)](_0x4789e8,_0x2f620a){const _0x4f2aa2=_0x5847ba;if(!this[_0x4f2aa2(0x119)][_0x2f620a])throw new common_1[(_0x4f2aa2(0x13e))](_0x4f2aa2(0x136),common_1[_0x4f2aa2(0x101)][_0x4f2aa2(0x145)]);const _0x8901da=await this[_0x4f2aa2(0xdc)]['getUserFromOpenId'](_0x4789e8,_0x2f620a);this['scanedSceneStrMap'][_0x2f620a]=_0x8901da['id'];}async[_0x5847ba(0x103)](_0x236e44,_0x463690){const _0x4b8379=_0x5847ba;if(!this['sceneStrMap'][_0x463690])return;const _0x345cd9=this[_0x4b8379(0x106)][_0x463690];if(!_0x345cd9)return'';const _0x5f0f09=await this[_0x4b8379(0xdc)]['getUserById'](_0x345cd9);return delete this[_0x4b8379(0x106)][_0x463690],this[_0x4b8379(0xe6)]['loginByOpenId'](_0x5f0f09,_0x236e44);}async[_0x5847ba(0xef)](_0x23c946,_0x3715c2){const _0x57b9e6=_0x5847ba;if(!this[_0x57b9e6(0x119)][_0x3715c2])throw new common_1[(_0x57b9e6(0x13e))]('非法参数',common_1[_0x57b9e6(0x101)][_0x57b9e6(0x145)]);const _0x1fe77b=_0x3715c2[_0x57b9e6(0xe5)]('/')[0x1],_0x322e69=await this[_0x57b9e6(0xdc)][_0x57b9e6(0x122)](_0x23c946,_0x1fe77b);this[_0x57b9e6(0x106)][_0x3715c2]=_0x322e69;}async['bindWxBySceneStr'](_0xd3242c,_0x42d86a){const _0x87d89c=_0x5847ba;if(!this[_0x87d89c(0x119)][_0x42d86a])throw new common_1[(_0x87d89c(0x13e))]('非法参数',common_1['HttpStatus'][_0x87d89c(0x145)]);const {id:_0x425a46}=_0xd3242c['user'],_0x5781e3=this[_0x87d89c(0x106)][_0x42d86a];if(!_0x5781e3)return'';return delete this[_0x87d89c(0x106)][_0x42d86a],_0x5781e3;}async[_0x5847ba(0xe7)](_0x1bf0ae,_0x1b1fc9,_0x53571c){const _0x4efc97=_0x5847ba,_0x5e6037=await this[_0x4efc97(0x11d)][_0x4efc97(0xe2)]([_0x4efc97(0x11a)])||_0x4efc97(0xdf);return await this[_0x4efc97(0x142)]([_0x5e6037,_0x1b1fc9,_0x53571c][_0x4efc97(0x13a)]()[_0x4efc97(0x126)](''))==_0x1bf0ae;}[_0x5847ba(0x142)](_0x42c365){const _0x16bd65=_0x5847ba;return crypto[_0x16bd65(0xff)](_0x16bd65(0x142))['update'](_0x42c365)[_0x16bd65(0x139)](_0x16bd65(0x121));}async[_0x5847ba(0xee)](_0x4fb988,_0x4dfdc5){const _0x1ba242=_0x5847ba,_0x45b0ec=await this[_0x1ba242(0x11d)]['getConfigs']([_0x4dfdc5]);return this[_0x1ba242(0x129)](_0x4fb988,_0x45b0ec);}async[_0x5847ba(0x129)](_0x68fa9e,_0x3f651c){const _0x141336=_0x5847ba;return'\x0a\x20\x20\x20\x20<xml>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<ToUserName><![CDATA['+_0x68fa9e[_0x141336(0x130)][0x0]+_0x141336(0x13b)+_0x68fa9e[_0x141336(0xeb)][0x0]+_0x141336(0x116)+new Date()[_0x141336(0x147)]()+_0x141336(0x12c)+_0x3f651c+']]></Content>\x0a\x20\x20\x20\x20</xml>';}async[_0x5847ba(0x11f)](_0x337c1c){const _0x4fcdcc=_0x5847ba,_0x269bcb=new Promise((_0x20f128,_0x4661c1)=>{setTimeout(()=>{const _0x51745f=_0x5b86;_0x4661c1(new Error(_0x51745f(0x10f)));},0x12c0);});let _0x489fbe='';try{console[_0x4fcdcc(0xed)](_0x4fcdcc(0x120),_0x337c1c);const _0x3c941c=await Promise[_0x4fcdcc(0xea)]([this[_0x4fcdcc(0x10c)][_0x4fcdcc(0x117)](_0x337c1c),_0x269bcb]);_0x489fbe=_0x3c941c||await this[_0x4fcdcc(0x105)][_0x4fcdcc(0x125)](_0x337c1c);}catch(_0x3a7068){console[_0x4fcdcc(0xed)](_0x4fcdcc(0xe0)),_0x489fbe=await this['globalConfigService']['getConfigs']([_0x4fcdcc(0x13c)])||_0x4fcdcc(0xe4);}return _0x489fbe;}};OfficialService=__decorate([(0x0,common_1['Injectable'])(),__metadata(_0x5847ba(0x137),[autoreply_service_1[_0x5847ba(0xf7)],user_service_1[_0x5847ba(0x11e)],auth_service_1[_0x5847ba(0x148)],globalConfig_service_1[_0x5847ba(0xf6)],chatgpt_service_1[_0x5847ba(0xfa)]])],OfficialService),exports[_0x5847ba(0x131)]=OfficialService; |