faker3/jd_wxShopGift.js

22 lines
109 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-09-03 15:20:23 +08:00
活动名称店铺礼包 · 超级无线/超级会员
2024-06-28 15:38:28 +08:00
活动链接https://lzkj-isv.isvjd.com/wxShopGift/activity?activityId=<活动id>
2024-09-03 15:20:23 +08:00
https://cjhy-isv.isvjcloud.com/wxShopGift/activity?activityId=<活动id>
环境变量jd_wxShopGift_url // 活动链接(必填)
jd_wxShopGift_notify // 是否推送通知true/false默认不推送
jd_wxShopGift_joinMember // 是否入会true/false默认不入会
jd_wxShopGift_pinFilter // 账号pin过滤,多个@链接
jd_wxShopGift_forbiddenQuit // 493后继续执行默认退出运行
jd_wxShopGift_isRun // 是否执行优惠券,积分类型活动,默认不执行
jd_wxShopGift_concThreads // 控制并发线程数正整数默认3
2024-06-28 15:38:28 +08:00
2024-09-03 15:20:23 +08:00
cron:1 1 1 1 *
2024-06-28 15:38:28 +08:00
*/
2024-09-03 15:20:23 +08:00
const $ = new Env('店铺礼包(超级无线/超级会员)');
function cJsnZfR(){}var vwVKv6U=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],wIh8eiX,yp_Kq6u,OoCmiwV,XWb90N0,yCad9G,MLDW7h,lxcsuI,nMIIFg,iCnfvC,DtlTAH,AMuyrE,tera99T,JKcWcQw,T7DRlRx,bnQs6l,a4pX0JW,yRBqmwY,TaZxld,tGv7sL,CNEeEL;function ASCfJvT(cJsnZfR){return wIh8eiX[cJsnZfR<0x126?cJsnZfR>0x23?cJsnZfR-0x24:cJsnZfR+0x2c:cJsnZfR-0x57]}wIh8eiX=VXuUTc();function NXCYmn(cJsnZfR,vwVKv6U){yp_Kq6u(cJsnZfR,ASCfJvT(0x24),{value:vwVKv6U,configurable:ASCfJvT(0x8c)});return cJsnZfR}cJsnZfR(yp_Kq6u=Object.defineProperty,OoCmiwV=NXCYmn(iylYrid((...vwVKv6U)=>{var yp_Kq6u=iylYrid(vwVKv6U=>{return wIh8eiX[vwVKv6U<0x2e?vwVKv6U-0x40:vwVKv6U<0x131?vwVKv6U-0x2f:vwVKv6U+0x7]},0x1);cJsnZfR(vwVKv6U[yp_Kq6u(0x2f)]=0x2,vwVKv6U[ASCfJvT(0x29)]=vwVKv6U[yp_Kq6u(0x43)]);return vwVKv6U[yp_Kq6u(0x30)](vwVKv6U[0x3e]())}),ASCfJvT(0x49))(FknFgl,I6Qsi3));var K8Y442=[],rih74P_=[drsYSw(0x0),drsYSw(ASCfJvT(0x25)),drsYSw(0x2),drsYSw(0x3),drsYSw(0x4),drsYSw(ASCfJvT(0x3f)),drsYSw(0x6),drsYSw(ASCfJvT(0x53)),drsYSw(ASCfJvT(0x40)),drsYSw(ASCfJvT(0x55)),drsYSw(0xa),drsYSw(ASCfJvT(0x43)),drsYSw(0xc),drsYSw(ASCfJvT(0x5d)),drsYSw(0xe),'\x6c\x39\x55\x65\x22\x46\x6d\x3b\x2b\x63\x59\x45\x4e\x7d\x46\x61\x40\x5a\x77\x5d\x73\x34\x63\x58\x56\x36\x72\x7c\x75\x31\x5f\x6c\x6c\x78\x76',drsYSw(0xf),drsYSw(ASCfJvT(0x44)),drsYSw(ASCfJvT(0x60)),drsYSw(0x12),drsYSw(0x13),drsYSw(ASCfJvT(0x42)),drsYSw(0x15),drsYSw(ASCfJvT(0xfa)),drsYSw(0x17),drsYSw(ASCfJvT(0x62)),drsYSw(ASCfJvT(0x45)),drsYSw(ASCfJvT(0x64)),drsYSw(0x1b),drsYSw(0x1c),drsYSw(0x1d),drsYSw(ASCfJvT(0xb2)),drsYSw(ASCfJvT(0x46)),drsYSw(0x20),drsYSw(0x21),drsYSw(0x22),drsYSw(ASCfJvT(0x28)),'\u0038\u0023\u0022\u002a\u0052\u007b\u0077\u0059\u0054\u0024\u002e\u006e\u0079\u0052\u0078\u0058\u002a\u0066\u0064\u0059\u0054\u006b\u0021\u0079\u0035\u0028\u0068\u006a\u004f\u0061\u007b\u0074\u0033\u0068\u007c\u004d\u0035',drsYSw(0x24),drsYSw(0x25),drsYSw(0x26),drsYSw(ASCfJvT(0x6a)),drsYSw(ASCfJvT(0x68)),drsYSw(ASCfJvT(0x2b)),drsYSw(ASCfJvT(0x27)),drsYSw(0x2a),'4y(1rRbVk7o"|u',drsYSw(0x2b),drsYSw(0x2c),drsYSw(0x2d),drsYSw(ASCfJvT(0x70)),drsYSw(ASCfJvT(0x72)),drsYSw(0x30),drsYSw(ASCfJvT(0x2a)),drsYSw(ASCfJvT(0x71)),drsYSw(ASCfJvT(0x26)),drsYSw(ASCfJvT(0x5a)),drsYSw(ASCfJvT(0x77)),drsYSw(ASCfJvT(0x78)),drsYSw(0x37),drsYSw(0x38),drsYSw(0x39),drsYSw(0x3a),drsYSw(0x3b),drsYSw(ASCfJvT(0x26)),drsYSw(ASCfJvT(0x7a)),drsYSw(ASCfJvT(0x27)),'^?N9r1laajbKbqO]3|uPR{.',drsYSw(0x3c),drsYSw(ASCfJvT(0x28)),drsYSw(0x3d),drsYSw(ASCfJvT(0x29)),drsYSw(0x3f),drsYSw(0x40),drsYSw(0x41),drsYSw(0x42),drsYSw(0x43),drsYSw(ASCfJvT(0x83)),drsYSw(0x45),drsYSw(0x46),drsYSw(0x47),drsYSw(0x48),drsYSw(0x49),drsYSw(0x4a),drsYSw(0x4b),drsYSw(0x4c),drsYSw(0x4d),drsYSw(ASCfJvT(0x86)),drsYSw(ASCfJvT(0x75)),drsYSw(0x50),drsYSw(0x51),drsYSw(ASCfJvT(0x56)),drsYSw(0x53),drsYSw(ASCfJvT(0x88)),drsYSw(ASCfJvT(0x2a)),drsYSw(0x55),drsYSw(0x56),drsYSw(ASCfJvT(0x48)),'\u0069\u0048\u004b\u0033\u0054\u0068\u0041\u0025\u0030\u005e\u0069\u002a\u006d\u0073\u0065\u0058\u007d\u0029\u0044\u0044\u007c\u007b\u0048\u0045\u0048\u006f\u006b\u0044\u003c\u0036\u0056\u005b\u006b\u0067\u0079\u0051\u0056\u0078\u0050\u0059\u007b',drsYSw(0x58),drsYSw(ASCfJvT(0x7e)),drsYSw(ASCfJvT(0x2b)),drsYSw(0x5a),drsYSw(ASCfJvT(0x2c)),drsYSw(0x5b),drsYSw(0x5c),drsYSw(ASCfJvT(0x2c)),drsYSw(0x5d),'\u007a\u0058\u0054\u0062\u003c\u0023\u0052\u0050\u0039\u007c\u003e\u002b\u006d\u0032\u0071\u0058\u003b\u003b\u0060\u0022\u0052\u006a\u0048\u0049\u005a\u0063\u003d\u0041\u0035\u0052\u0067\u0030\u0034\u0023\u0041\u0052','\x58\x76\x26\x68\x6b\x51\x23\x7c\x2c',drsYSw(0x56),drsYSw(0x5e),drsYSw(0x5f),drsYSw(0x60),drsYSw(ASCfJvT(0x2c)),drsYSw(0x61),drsYSw(ASCfJvT(0xd2)),drsYSw(ASCfJvT(0x2b)),drsYSw(ASCfJvT(0x6b)),drsYSw(0x64),drsYSw(0x65),'edJ{|sb/&*qrxW#2)Bz','\u0065\u0064\u004a\u007b\u007c\u0073\u0075\u007a',drsYSw(0x66),'B3<(pCT!C@C|3lUaI*m($',drsYSw(ASCfJvT(0x7c)),drsYSw(0x68),drsYSw(ASCfJvT(0x2e)),drsYSw(ASCfJvT(0x2c)),drsYSw(ASCfJvT(0x8d)),drsYSw(ASCfJvT(0x8e)),drsYSw(0x6c),drsYSw(0x6d),drsYSw(0x6e),drsYSw(0x6f),drsYSw(ASCfJvT(0x92)),drsYSw(0x71),drsYSw(ASCfJvT(0x8f)),drsYSw(0x72),drsYSw(
2024-06-28 15:38:28 +08:00
// 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"])