mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
20 lines
65 KiB
JavaScript
20 lines
65 KiB
JavaScript
|
/*
|
|||
|
活动名称:组队瓜分奖品 · 京耕
|
|||
|
活动链接:https://jinggeng-isv.isvjcloud.com/ql/front/showPartition?id=<活动id>&user_id=<店铺id>
|
|||
|
环境变量:jd_jinggeng_showPartition_activityUrl // 活动链接
|
|||
|
|
|||
|
7 7 7 7 * jd_jinggeng_showPartition.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('组队瓜分奖品(京耕)')
|
|||
|
const notify = $.isNode() ? require('./sendNotify') : ''
|
|||
|
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const getH5st = require('./function/getH5st3_0')
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const IlII1i11=iiiilll1;(function(I1liIi1I,IiI1Iiil,iIiliiIi,IllIllII,iliiii,l1iIlilI,II1Ii){return I1liIi1I=I1liIi1I>>0x5,l1iIlilI='hs',II1Ii='hs',function(li11i1ii,iiIIIlil,lII1l1II,I1l1ii,Ill111i){const liil1lI1=iiiilll1;I1l1ii='tfi',l1iIlilI=I1l1ii+l1iIlilI,Ill111i='up',II1Ii+=Ill111i,l1iIlilI=lII1l1II(l1iIlilI),II1Ii=lII1l1II(II1Ii),lII1l1II=0x0;const l11l1llI=li11i1ii();while(!![]&&--IllIllII+iiIIIlil){try{I1l1ii=parseInt(liil1lI1(0x395))/0x1+parseInt(liil1lI1(0x1ce))/0x2*(-parseInt(liil1lI1(0x30d))/0x3)+-parseInt(liil1lI1(0x211))/0x4*(parseInt(liil1lI1(0x2be))/0x5)+parseInt(liil1lI1(0x2af))/0x6*(parseInt(liil1lI1(0x3e6))/0x7)+parseInt(liil1lI1(0x286))/0x8*(parseInt(liil1lI1(0x2cb))/0x9)+-parseInt(liil1lI1(0x301))/0xa*(-parseInt(liil1lI1(0x305))/0xb)+-parseInt(liil1lI1(0x272))/0xc;}catch(lli1i1Il){I1l1ii=lII1l1II;}finally{Ill111i=l11l1llI[l1iIlilI]();if(I1liIi1I<=IllIllII)lII1l1II?iliiii?I1l1ii=Ill111i:iliiii=Ill111i:lII1l1II=Ill111i;else{if(lII1l1II==iliiii['replace'](/[OqUpANlxIMErYRyKtuX=]/g,'')){if(I1l1ii===iiIIIlil){l11l1llI['un'+l1iIlilI](Ill111i);break;}l11l1llI[II1Ii](Ill111i);}}}}}(iIiliiIi,IiI1Iiil,function(Il111lll,I1l1llII,ii1II11i,lIliiIil,IiiIi1I,ilI1lIIl,IliiiiI){return I1l1llII='\x73\x70\x6c\x69\x74',Il111lll=arguments[0x0],Il111lll=Il111lll[I1l1llII](''),ii1II11i=`\x72\x65\x76\x65\x72\x73\x65`,Il111lll=Il111lll[ii1II11i]('\x76'),lIliiIil=`\x6a\x6f\x69\x6e`,(0x1367d3,Il111lll[lIliiIil](''));});}(0x1860,0x814e7,IIiiiilI,0xc5),IIiiiilI)&&(version_=IIiiiilI);let domains=IlII1i11(0x276);$[IlII1i11(0x1a3)]=process[IlII1i11(0x24c)][IlII1i11(0x35d)]?process[IlII1i11(0x24c)][IlII1i11(0x35d)]:'',$[IlII1i11(0x394)]=getQueryString($[IlII1i11(0x1a3)],'id'),$[IlII1i11(0x3bf)]=getQueryString($[IlII1i11(0x1a3)],IlII1i11(0x21d)),$[IlII1i11(0x1c5)]='',$[IlII1i11(0x253)]=![],$[IlII1i11(0x37e)]='',$[IlII1i11(0x1d5)]='',$[IlII1i11(0x3ea)]=[],$[IlII1i11(0x27c)]='',$[IlII1i11(0x3eb)]=-0x1,$[IlII1i11(0x3e1)]=0x0,$[IlII1i11(0x3ee)]=0x1,$[IlII1i11(0x35b)]='',$[IlII1i11(0x22e)]=0x0,$[IlII1i11(0x2c6)]=[],$[IlII1i11(0x1c8)]=IlII1i11(0x1aa),$[IlII1i11(0x245)]=0x5,$[IlII1i11(0x333)]=[],$[IlII1i11(0x3d3)]=0x0,$[IlII1i11(0x2ec)]=[];let cookiesArr=[],cookie='',activityCookie='';if($[IlII1i11(0x2e8)]()){Object[IlII1i11(0x30a)](jdCookieNode)[IlII1i11(0x1ea)](ii1I1Il1=>{const il1l1I1I=IlII1i11;cookiesArr[il1l1I1I(0x2e1)](jdCookieNode[ii1I1Il1]);});if(process[IlII1i11(0x24c)][IlII1i11(0x24d)]&&process[IlII1i11(0x24c)][IlII1i11(0x24d)]===IlII1i11(0x371))console[IlII1i11(0x314)]=()=>{};}else cookiesArr=[$[IlII1i11(0x1cc)](IlII1i11(0x2da)),$[IlII1i11(0x1cc)](IlII1i11(0x398)),...jsonParse($[IlII1i11(0x1cc)](IlII1i11(0x2ce))||'[]')[IlII1i11(0x21a)](lIlliii1=>lIlliii1[IlII1i11(0x255)])][IlII1i11(0x3da)](Illi11l=>!!Illi11l);!(async()=>{const i1lll11=IlII1i11,ii1llli={'YxBEn':function(III11iIi,l1I1liIl){return III11iIi===l1I1liIl;},'TwtLY':i1lll11(0x371),'hmvvW':i1lll11(0x30c),'RyhTg':i1lll11(0x36d),'odRzj':function(II11l11i,ili1llil){return II11l11i<ili1llil;},'ckCjf':function(I1IIi1lI,i1IIiI1I){return I1IIi1lI===i1IIiI1I;},'ICgKH':i1lll11(0x293),'GhxeY':i1lll11(0x2b6),'QgdHK':function(I1i1i1l1,iliilI1i){return I1i1i1l1(iliilI1i);},'Sbsgo':function(i1lilli,iI1i11ii){return i1lilli+iI1i11ii;},'qegqO':function(Ii1I11,ilIi1il){return Ii1I11!==ilIi1il;},'hGUvA':i1lll11(0x26e),'jqOaA':function(lllIl1ll){return lllIl1ll();},'cUCpP':function(lil1Ii1I){return lil1Ii1I();}};console[i1lll11(0x314)](i1lll11(0x2bc)+$[i1lll11(0x1a3)]);if(!cookiesArr[0x0]){$[i1lll11(0x2eb)]($[i1lll11(0x2b5)],ii1llli[i1lll11(0x33a)],ii1llli[i1lll11(0x222)],{'open-url':ii1llli[i1lll11(0x222)]});return;}for(let iIi1Illl=0x0;ii1llli[i1lll11(0x2e7)](iIi1Illl,cookiesArr[i1lll11(0x3f2)]);iIi1Illl++){if(cookiesArr[iIi1Illl]){if(ii1llli[i1lll11(0x1f2)](ii1llli[i1lll11(0x217)],ii1llli[i1lll11(0x310)])){Il1II111[i1lll11(0x30a)](i1IIII11)[i1lll11(0x1ea)](i1Il1l1i=>{const IiIiilI1=i1lll11;iI1iI11i[IiIiilI1(0x2e1)](ll1i1iiI[i1Il1l1i]);});if(ii1iIli1[i1lll11(0x24c)][i1lll11(0x24d)]&&ii1llli[i1lll11(0x218)](lIi1i1i1[i1lll11(0x24c)][i1lll11(0x24d)],ii1llli[i1
|
|||
|
|
|||
|
// 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.d
|