faker3/jd_OpenCard_Force.js

19 lines
69 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称强制入会
活动链接https://shopmember.m.jd.com/shopcard/?venderId=<商家ID>
环境变量jd_opencard_force_venderId // 商家ID多个用英文逗号分割
jd_opencard_force_task_threads // 控制店铺并发线程数正整数默认1最大3
jd_opencard_force_account_threads // 控制账号并发线程数正整数默认1最大3
jd_opencard_force_account_interval // 自定义运行间隔时长整数单位毫秒默认0
7 7 7 7 *
*/
const $ = new Env('强制入会')
function WlKXBxT(){}var TzLiuy4=Object['defineProperty'],CEWjo03,FEfQM1I,F4Y1p5e,YwiepNC,ygzABFl,DF9puA,X2BOaKy,YgvMQL,kXXBkEc,rP89H8v,qNnCStT,roAh3x,IKTQeO,s96_2zT,c5jzqkc,FpNo4QL,UcqRt27;function Ifotgma(WlKXBxT){return CEWjo03[WlKXBxT<0x36?WlKXBxT-0x2a:WlKXBxT>0xc2?WlKXBxT-0x8:WlKXBxT-0x37]}CEWjo03=FYFqPG();function wsVrMAn(WlKXBxT,TzLiuy4){FEfQM1I(WlKXBxT,'length',{value:TzLiuy4,configurable:Ifotgma(0x82)});return WlKXBxT}FEfQM1I=Object.defineProperty;var NYbguBB=[],bNdJiN=['Cg`;}ut2','3%g;xc02','H96n*t_g7','=o|EuM}2','w3t:~O*2','k1j&S.gMg`iYaC','ns{2%','^#.x]:kkift','%*zSaaUJw!X(>M','>rI&E','XJ1{,?Tw','bXA+ws@w','gNShl;6w','(JUC','bXA+vr!pn:M_l','&}ZV0',')IB(b',Ifotgma(0x37),'dk=n~w^j','8:#N@','CHUN','=T)AR8>9%.4$P_>r4k]nf5dXUy7xtPVr','tpI*8wE','=T)AR8^j',':(xgL$fj','@qx~b`fj','f&Q~(53j','`k=n7$Bj','=T)AR8>9%.4$P_>r4k]nf5Zy%.cA4ekY`lk*C+0y0','=T)AR8>9%.4$P_>r4k]nf5Zy%.cA4ekYeH5*m9^fDy',']!"4{','Z&9(','HFB(*`pj','7lxgjp3j',':7f(','j&#*t','CjoJP#k}>{l3_P`wJd?}>D9_t~*]vH#a!*$nt','J+V(@','Fqo7#GVj','7FzNX`E','j&#*t',Ifotgma(0x37),'7lxga62VK.CiZ','rqf(','JANczi]q;<|#u~r7KS(T','d|+#Ybz}zbgu&<h9^N?MV"Z','l]#r9#Vnd+IJaf`wBrH^:1Z','0[n!|gr22Y','i"K!','JANczi]:vHBUbzaBh|oT','YD8vGPu7zbV7"GP)~,}o0%Z','0w5vT/iUu2}',Ifotgma(0x3b),'>eHa+Aq+vzPqv[','("basgOzQR','#&V(;:{j','0[n!y','1!5*]`UyO.uxZ','H?qL(','rqf(',')I+~UiE','rq7nY9pj','HFy*^KZg0','u.J76AFj','h.tSq+h@D','+Ba7.8=j','bqy*t','7FzNX`E','Fq{~TG^j','V!Q~B+;XR','1!zN','1!+~YiHj','aqv*L~qZ','/kXnk~]j',Ifotgma(0x3a),Ifotgma(0x38),'H(2qdb?[Zzs_3~,:]o','uP]SURgOT','xfr*t%>l','k[`>6d9|w','Z<2qiR:Oqp[@e0dvJo','"f4Z+~pWZIn}uD"]$N','57[g:kP;gy','zp[g=6rOW.7iFebmVZ','KVC*,d$l','K&0{78;A','8v$KwwE','~9yLwYqO5a(NZI<`','p(5*t_GVYdIkZ','$lS(}7YA{.9$yc^H=F/7n4E',Ifotgma(0x39),'X!zN','pgQZ',Ifotgma(0x38),':EFq','BJk*:~)xZ?Q','1!+~YiHj,OQxu=1vpT}kISHj',Ifotgma(0x3c),':Xs;O&$n8~CLE@a9yA.}t"03=$@!Z0','V<,LQS1A','w(hqP@vA','mFE(QkP;gy','w(hq"CpOE>',')@Q$ZR5_R21','iPNJ(','eH:*m93j','v(PX#3_A','qJX0C9{j','=FQ~X4nwqo7itPA=TZ',')@Q$ZRao','Mg6F',']<>X3D(A','rqf(','ZEQ$U','rqf(',':EFq','IMh`PTSuriI{d`dD;zW!%Fo','+%Q_h{]nqtAx".$wEW&',':EFq','rqf(',Ifotgma(0x38),':EFq','H(2qdb?[Zzs_3~,:]o',':EFq','UJzN"wtZ','o}efcGZZ','gHX(J*Pj','SU.`^K{j','x9l{u.|A','7Fi7b','0q@0z','T7:LK"h','loz&/;E','T7:LG"h','$lS(,KYA{.9$mQ3Y=T)AX4;j','1Q^~~w/2=/IkZ','1!+~YiHj,OQxu=1vpT}kISHj','X;"uMXiH?pZIH6fv','o9v~YZh','~v$nL~3j','tqXnX','Y!/({`OgJ"','&&PYE8Kpgys','VPmCg/Do','.@,LL3vA','3CkFC*(Z','Q<6F,MqOM>UMZ|<',';FVYB$E','$]_CPXy*n','1!zNqUIt0','&&k*[KIt("D6Z','7lxga6Hj','<<.WV','Q7?i1','zP>XXDiA','uHmRt','WkM|hZjq,`<m7iIS}0','WkM|xzYWjPKyo$^}a6{3:r<"]','V<$u<Dc#}aN);b?vqo','2kV(*`%pB1zk(BlvTZ','p(5*t_GVYdIkZ','2@vu[','2q@LiRvA','PkjDW@%HDNb','ZP[qQ','6os#i*w','<)IE^>Y[','67:*dS=j','[kB(','V!zN*41j','y!kf{`ry0','c(]n&83j','Pd2B','c(]n&8?AcTKe)eDU)^I','!jq|}5(}BP"QkiZSz;jkv','v|U5#/xBWytepdqT`$_','X]7RB{+h','X]rBv.vA','gn"E{,00','7@RS}?vA','eh,EM>g[',':HX(J*Pj',',cpnm9qO0','+GtuPXZsk2_<pdmJyHr3oF3Bc2','|c]n*e^j','e|Q5%<g[','.U9(=<E','VvU5Ei^q&P/xvRHSu0','(E_Xi','/d2qLRm[rTMYzbt','T7YqN?kTEac=G6]dzao3+uM4}aDe,Utvx9]S&"=[n','r7[gMnGHA"+iZ','<}{~TG^j','jj@LmSKA','A_NEq',')k.E57?!?','X0gT','7lxga62VK.CiZ','~$aEEf_!?','5d}rKf+(?','olmnaOw',Ifotgma(0x39),'UPl{NSswn','1!+~]4X/e?CnFeFmNZ','CJrfcG=j','$l{~gsOgUybOU&','1!zNt4)x=/7iFebmVZ',Ifotgma(0x3a),Ifotgma(0x39),'HFgN','GLcUP#SU/FX7gR"','1!y*2CE','Fq{~TG^j','eHXnW[E','7FzNX`E','V!Q~B+;XR',Ifotgma(0x37),'$lt74wE',Ifotgma(0x3b),Ifotgma(0x37),'$lt74wE','{QONF','AvB(','CR4n)h3j','8k{~b`Uy0','QI9(','7lxga6Hj','!!+D@','|czN','Fq^~v4pXR','&&x~n`v9}^','QIzNF','*kk*Y<E','V7|ky','!!lKJ$^j','xkMi]4;j','aqy*L~3j','6kb*OGQXR','X!5*k~.XN^R6h&','~v=nH9v9qo9$mPN=','wvi7%+vj','i:Z7{`pj','@!q*!GLXR','J+;~q9ay0',';qXntK^j','l,@n}9&f]/3','l,Cn]K>9T.LxZ','al`K{','&&x~n`eZ','rqkf@','PJk*:~Vj','[}S(X`)9R','~:^~~w{j','6kS(a<E',';kx~q9E','l`r*iBhO7yJ',',cpnm9>9%.g0Bb"alZ','oI^~{`$TTo<$Z',':.kfABhO7yJ','X!zN0GBX7/`iZ','~v=nH9%x]/Qd!3c','X!5*4KBXQ.>pvWT','X!5*4K;j','YT$n~w^j','~v=nH9+G]/"k9![HNZ','~v=nH9uZ','$U_f#GTj','@Q=n*`Xxq"5dYPxHPZ','u7;@#uE','u7?{:~GVK"',Ifotgma(0x3c),'j!0KQLdV0','j!0KH7Tj0',']`J7X4vj
// prettier-ignore
function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])