mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 08:19:11 +08:00
14 lines
149 KiB
JavaScript
14 lines
149 KiB
JavaScript
|
/*
|
|||
|
活动名称:2.28 年在一起抽奖
|
|||
|
活动链接:https://pro.m.jd.com/mall/active/2SPD9SANqEbYq9zMfivnHsSjgpBR/index.html
|
|||
|
活动变量:jd_nzyq_task //是否做任务获取次数,默认开启
|
|||
|
|
|||
|
cron:59 23 29 2 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('2.28 年在一起抽奖')
|
|||
|
function HnMMGXP(){}var kfxfJx=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],OOaQhuI,yG_CdYu,B8rsENM,vZiS9J,OsqYRz,Bjn7z8,EFWs9GG,DuNZST,q75ahE,_mUNKQx,p_ljJo,GvOD7VI,bX6WT5,Nnn7xB,w4sXMr,hJgT5F,hq7R0n,fB0g9s,qiBIrIM,hkn2je,jtOh05t,Pf0WBWo;function KY5au8(HnMMGXP){return OOaQhuI[HnMMGXP>0x8b?HnMMGXP-0x21:HnMMGXP<-0x43?HnMMGXP+0x2d:HnMMGXP+0x42]}HnMMGXP(OOaQhuI=v9ItWY0(),yG_CdYu=zr95jYT((HnMMGXP,kfxfJx)=>{return kfxfJx(HnMMGXP())},0x2)(boXSoV,rDPkKd));var uAfv1C0=[],y5wfl7=[CCZX8A7(0x0),'\x64\x73\x33\x3d\x6e\x23\x4a\x2b','\x50\x7b\x42\x7c\x21\x6f\x26\x3f','\x60\x71\x31\x53\x77\x34\x51\x48',CCZX8A7(0x1),'LNY88|2','Pv=Uk#E3t=85Hgt',CCZX8A7(KY5au8(-0x18)),'\x2f\x5d\x6b\x4c\x43',CCZX8A7(0x3),'\x31\x74\x45\x56\x4d\x28\x50\x4a\x7c\x68\x39\x60\x2b\x68\x4b\x45\x33\x4b','$q%8X',CCZX8A7(0x4),CCZX8A7(KY5au8(-0x12)),'\x31\x74\x45\x56\x4d\x28\x50\x4a\x7c\x68\x46\x2f\x4c\x67\x47\x31',CCZX8A7(0x6),'\u0031\u0074\u0045\u0056\u004d\u0028\u0050\u004a\u007c\u0068\u0078\u005f\u004e\u0024\u0032\u0022\u0075\u0050\u0073\u004c','\u0031\u0074\u0045\u0056\u004d\u0028\u0050\u004a\u007c\u0068\u0078\u005f\u004e\u0024\u0071\u002b\u0043\u0063\u0061\u006c\u0046\u0079\u0032','\u0071\u004f\u0073\u004e\u0074','\x31\x74\x45\x56\x4d\x28\x50\x4a\x7c\x68\x69\x21\x25\x31\x41','\u0079\u0059\u004e\u0077\u0053\u007c\u0032','\u0075\u0055\u007b\u003f\u0034\u0040\u0026\u0049\u004b\u0060\u007d\u005f\u004c\u0072\u0048\u0046\u003f\u0065\u002a\u0025\u0077\u0053\u003e\u0033\u0038\u0060\u003c','\x3c\x50\x3a\x77\x42\x23\x5a\x34\x6f','\x74\x74\x54\x5b\x72\x77\x52\x48',CCZX8A7(0x7),'\u004b\u004e\u0078\u004d','<P5M8|TH',CCZX8A7(KY5au8(-0x15)),'\x48\x4e\x6b\x38\x58','\u004f\u0048\u003d\u0062\u0068\u006b\u0071\u0022\u0037\u005b\u0064\u0072\u0024\u0068\u007c\u0034\u0062\u0060\u0026\u0022\u0037\u0069\u0078\u0024\u0058\u0077\u0038\u0061\u0044\u003c\u006b\u006d\u0063\u0038\u005f\u0053\u0058','\x62\x29\x57\x4d\x43',CCZX8A7(0x9),'\u0048\u004e\u006b\u0038\u0058','\u0052\u0063\u0073\u004c\u0045\u0078\u0049\u0021\u002b\u0060\u0055\u003f\u0050\u0039\u0066\u0049\u0057\u004b','\u0050\u0076\u003d\u0055\u006b\u0023\u0057\u0048','UPsL3|2',CCZX8A7(KY5au8(-0x19)),CCZX8A7(KY5au8(-0x4)),CCZX8A7(KY5au8(-0x1c)),CCZX8A7(0xc),'\x52\x63\x29\x77\x61\x3b\x33\x3e\x39\x26\x4f\x53\x50\x39\x50\x49\x4c\x4b','\u004f\u0062\u0075\u004a\u0042\u0023\u0031\u0048','\u003f\u0066\u0042\u0051\u0059\u0035\u0062','\u0039\u0066\u0053\u004a\u005e\u0076\u007d\u005f\u007c','\u005e\u0045\u004d\u003b\u0068\u0030\u007e\u0031\u0031\u0063','g<]8;4/yU>dnIN',CCZX8A7(0xd),'\u0038\u006c\u0039\u0060\u005a','\u0052\u0063\u007e\u0038\u0061\u007c\u0046\u005a\u0041\u007a\u006c\u0070\u004b','\x6a\x54\x75\x38\x6e\x77\x6a\x5a\x71\x5a\x29\x3f\x7b\x7c\x79\x3c',CCZX8A7(0xe),CCZX8A7(KY5au8(-0xf)),'\u0075\u0076\u0055\u0053\u002b\u0078\u0054\u0048','\x3c\x50\x5a\x38\x51\x40\x4b\x56\x6a','mM4qhpjK','\u0055\u0064\u0070\u0056\u0048\u0054\u0072\u0048',CCZX8A7(0x10),CCZX8A7(0x11),CCZX8A7(KY5au8(-0x14)),'9<$8/46u!&+,E$%1{BaSk#`3+&)?K','\u004a\u007d\u004f\u0029\u0078\u0026\u0059\u002c\u0054\u006d',CCZX8A7(0x13),'*YAL_:&A]B','\x7c\x77\x38\x78\x2b\x39\x4a\x31','\u0049\u0043\u005a\u0038\u0036\u0040\u0035\u0048','\u0021\u004f\u005d\u0039\u006a\u006b\u0042\u0041\u0077','\x43\x63\x61\x6c\x46\x79\x32',CCZX8A7(KY5au8(-0xe)),'\u0058\u0076\u002c\u004d\u0033\u007c\u002a\u0078\u006f','\u003a\u005e\u0029\u002f',CCZX8A7(0x15),KY5au8(-0x3b),'9<$8/46u!&+,E$%17"k8X','\x5d\x45\x69\x37\x3d\x22\x44\x33\x2e\x46\x7c\x70\x75','\x56\x48\x74\x6b\x49\x22\x59\x31',CCZX8A7(KY5au8(-0x13)),CCZX8A7(0x17),'\u0029\u007b\u006f\u006b\u0051\u0054\u006f\u0031\u0039\u006d',CCZX8A7(KY5au8(-0x1e)),CCZX8A7(0x19),'\x29\x7b\x6f\x6b\x21\x6e\x36\x41\x4a\x71\x7c\x4b\x22\x6f\x6f\x3a\x5a\x75','\u004a\u004e\u003a\u0077\u0021\u0039\u006a\u0034\u0039\u0026\u0034\u002e\u0022\u0039\u0074','sv(/Q,.6.Lw.vNO*Ifv','\u0029\u007b\u006f\u006b\u006f\u003c\u006a\u0053\u0057\u0074\u005b\u003c\u0034\u004e\u006f\u003a','0}A_@fiR7?5]YI2g`J',CCZX8A7(KY5au8(-0xd)),'\x47\x59\x34\x78\x62\x6e\x36\x41\x4a\x71\x3d\x56\x3e\x59\x5d\x66\x5e\x5b\x76','\x6a\x67\x75\x36\x32\x50\x46\x46\x30\x23','\u0051\u004f\u0
|
|||
|
// 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
|