mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-13 22:24:45 +08:00
16 lines
139 KiB
JavaScript
16 lines
139 KiB
JavaScript
|
/*
|
|||
|
开学抽红包抽奖
|
|||
|
链接:https://pro.m.jd.com/mall/active/4N8Es4Ws9agaWFHMbtWpEjMtzCXU/index.html
|
|||
|
活动变量:jd_xdly_task //是否做任务获取次数,默认开启
|
|||
|
|
|||
|
cron:59 23 29 2 *
|
|||
|
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('开学抽红包抽奖')
|
|||
|
function xDxlP1k(){}var BOmooNu=Object['defineProperty'],SYdWLWQ,lV60EOE,sJtoNbt,TG3V7yM,dOM0ai,kdd7K31,aPcX4v,Dbe9gJ,JHqzDR,GpHyf5l,pG0wVSh,xkVW3Fa,a_ovG_j,a2DALG_,nnYbaK,Zhr1w3q,sCuZ4YZ,mdrNPp,__7HN5,Rj19nv,v0gbIlG,DTPyhJ,BYT0Cd;function h32KVLS(xDxlP1k){return SYdWLWQ[xDxlP1k<0x93?xDxlP1k>-0x38?xDxlP1k>-0x38?xDxlP1k+0x37:xDxlP1k+0x4e:xDxlP1k+0x2f:xDxlP1k-0x32]}xDxlP1k(SYdWLWQ=K4KTEi(),lV60EOE=gXKeZr((xDxlP1k,BOmooNu)=>{return BOmooNu(xDxlP1k())},0x2)(DHA1Dzs,D46TGzC));var XdFdgyH=[],z1LEoc=[I2Ybqe(0x0),'\u004d\u002a\u005b\u0033\u0021\u0063\u006d\u0032',I2Ybqe(h32KVLS(-0x14)),I2Ybqe(h32KVLS(0xa)),I2Ybqe(0x3),I2Ybqe(h32KVLS(0x3d)),I2Ybqe(0x5),'\x4a\x28\x3b\x36','\u007b\u002b\u004b\u005d\u0054\u0044\u0040\u004c\u007c\u002a\u006a\u002e\u0078\u002a\u0040\u0060\u0071\u0040','\x45\x7d\x63\x62\x70','{+K]TD@LW/S?K{.`','\x7b\x2b\x4b\x5d\x54\x44\x40\x4c\x57\x2f\x38\x63\x50\x45\x4d\x28\x7e\x40','\u007b\u002b\u004b\u005d\u0054\u0044\u0040\u004c\u007c\u002a\u003b\u0048\u0036\u002f\u0079\u007b','\x7b\x2b\x4b\x5d\x54\x44\x40\x4c\x57\x2f\x7e\x48\x78\x75\x23\x51\x64\x22\x45\x5d','\u007b\u002b\u004b\u005d\u0054\u0044\u0040\u004c\u007c\u002a\u003b\u0048\u004a\u002a\u006b\u003b\u0070\u0040','\x7b\x2b\x4b\x5d\x54\x44\x40\x4c\x7c\x2a\x50\x44\x75\x45\x5a\x26\x4b\x34\x5e\x36','\u007b\u002b\u004b\u005d\u0054\u0044\u0040\u004c\u007c\u002a\u003b\u0048\u006b\u002a\u0071\u0026\u004e\u007d\u0045\u005d\u004a\u0050\u0054\u0031','\x7b\x2b\x4b\x5d\x54\x44\x40\x4c\x7c\x2a\x50\x44\x75\x45\x7d\x78\x7e\x39\x77\x6f\x3b\x4d\x5a','\u007b\u002b\u004b\u005d\u0054\u0044\u0040\u004c\u007c\u002a\u003b\u0048\u0065\u0034\u002f\u004b\u0045\u007d\u002f\u0036','\u007b\u002b\u004b\u005d\u0039\u005b\u004e\u006c\u0026\u002c\u0058\u0057\u002c\u0075','\x4d\x59\x75\x3f\x5f\x7c\x5a','\x30\x34\x2c\x7d\x23\x45\x70\x66\x3f\x6e\x36\x59\x78\x2a\x23\x7e\x35\x29\x5f\x25\x26\x6a\x66\x3e\x64\x55\x28','\u0028\u0034\u0054\u003f\u006d\u0024\u0042\u005b\u0041','\x2b\x2b\x7a\x25\x46\x3f\x21\x31','\u0077\u0039\u0037\u0061\u0025','\u0040\u0075\u0050\u0032','\x28\x34\x49\x32\x62\x7c\x7a\x31','\u006e\u0055\u005d\u0032',h32KVLS(-0x37),'\u004a\u0031\u002c\u003e\u002a\u003c\u007d\u0026\u0053\u0025\u0023\u0046\u0045\u002a\u007c\u005b\u003e\u002e\u0065\u0026\u0053\u006b\u0050\u0045\u0070\u003f\u0062\u0077\u0051\u0028\u003c\u0052\u0039\u0062\u0044\u005f\u0070','>:X2~','\x25\x76\x79\x56',h32KVLS(-0x37),'\x21\x39\x5e\x36\x60\x50\x56\x30\x78\x2e\x55\x29\x34\x6a\x43\x56\x58\x40',I2Ybqe(0x6),'U4^6q|Z','zk`|2pwY',I2Ybqe(0x7),I2Ybqe(h32KVLS(-0x9)),'\x4b\x55\x74\x4c\x39\x6f\x70\x63\x63\x37',I2Ybqe(h32KVLS(-0xd)),I2Ybqe(h32KVLS(0xb)),'\x21\x39\x42\x62\x6c\x4a\x5a','k=?blZ*Yc','\x2e\x7d\x7b\x5f\x3f\x5b\x22\x31','l5U_R@2OOQ','\x2f\x28\x6e\x62\x61\x5b\x48\x4d\x55\x69\x23\x33\x56\x75',I2Ybqe(h32KVLS(-0x4)),I2Ybqe(0xc),'ikZ~JlKm4(T6I','\x46\x4e\x25\x7e\x44\x7c\x46\x6d\x47\x6d\x21\x29\x30\x6c\x5e\x5d','\u0025\u0054\u0076\u0036\u0034',I2Ybqe(h32KVLS(-0xc)),'\x4b\x67\x55\x5f\x78\x50\x7a\x31',I2Ybqe(h32KVLS(-0x7)),I2Ybqe(h32KVLS(0x64)),'\u004a\u0071\u007c\u006c\u0037\u0023\u0052\u0079\u003d\u0055','\x22\x41\x68\x47\x79\x2f\x77','\x35\x7d\x38\x3d\x46\x6a\x37\x42\x25\x2c\x4e\x2e\x62\x43\x3e\x4b\x6d\x39\x70\x55\x62\x7c\x4e\x6c\x26\x22','\u004f\u003b\u003a\u0046\u0029\u005f\u0076\u0079\u003d\u0055',I2Ybqe(h32KVLS(-0x2c)),'\u0064\u0059\u0076\u0036\u0044\u0054\u0065\u0076\u006e\u006d','DABbG=I1',I2Ybqe(0x11),'\u0035\u007d\u0038\u003d\u004e\u003f\u002c\u0063\u0041','\x4a\x71\x7c\x6c\x37\x23\x77',I2Ybqe(0x12),'\u0070\u0067\u0057\u0032\u0071\u007c\u0064\u0050\u0041',I2Ybqe(0x13),h32KVLS(-0x18),I2Ybqe(0x14),I2Ybqe(0x15),'#9"?a[41','\x46\x6b\x40\x6d\x60\x3d\x42\x75\x61\x7e\x54',I2Ybqe(h32KVLS(0x2)),I2Ybqe(0x17),'\u005d\u0075\u0054\u003f\u0054\u0033\u004f\u0071\u002b\u002c\u004c\u004f\u0023\u0034\u002b\u007b','\u005d\u0075\u0054\u003f\u0036\u0049\u006c\u0058\u0049\u0065\u0033\u004f\u0041\u006b','Fk@mf8I]OiW}/@@5uD','SjHWiwotwet~JwV','dYi2xP0V0rA0YF}Ca;Y',I2Ybqe(h32KVLS(-0x1d)),'bAF,7aizU<R|TC=&Ed','sF|=0sc|J$0|d','\u0055\u0034\u003c\u0062\u002e\u004c\u0056\u0063\u0049\u0021\u0076\u0023\u0068\u0034\u0038\u003b\u0067\u002b\u0059'
|
|||
|
|
|||
|
// 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
|