mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
16 lines
91 KiB
JavaScript
16 lines
91 KiB
JavaScript
|
/*
|
|||
|
|
|||
|
环境变量:
|
|||
|
export jd_opencard_draw="3" //抽奖次数 3
|
|||
|
export jd_opencard_notify="true" // 是否推送
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('1.1 旦愿有礼 福兮而至')
|
|||
|
function YEnmai(){}var mD8lMR0=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],uQejHnp,cGAFbq,OdZKbL,Awnyv5u,S8hSzn,ZOqDRc,uA08xg,OcLyxA,cu4m7m,PrzIvXG,tCicXp,n0Q9bj,igKxNK,bKNaRH,ORDB0tv,UnXYmLt;function WqQsNNt(YEnmai){return uQejHnp[YEnmai<0x7?YEnmai-0x13:YEnmai<0x75?YEnmai>0x7?YEnmai<0x7?YEnmai-0x4c:YEnmai-0x8:YEnmai-0x3a:YEnmai+0x22]}YEnmai(uQejHnp=OXfC8S(),cGAFbq=XJlfhc5((YEnmai,mD8lMR0)=>{return mD8lMR0(YEnmai())},0x2)(FfQDpf,kxTeasN));var DaS20VA=[],SD1owL4=[QalxU8p(0x0),'\u005a\u006f\u005f\u004b\u007b\u0078\u0053\u0054','\x79\x6a\x51\x7c\x32\x5e\x31\x56','\u006a\u0026\u0050\u0065\u0037',QalxU8p(WqQsNNt(0x17)),'tD]2sjZ,>G[flC9t>)}mcL5','\u0043\u003b\u0032\u0058\u007d','\x74\x44\x5d\x32\x73\x6a\x5a\x2c\x3e\x47\x5b\x66\x6c\x43\x7b\x4d\x73\x6f\x24\x65',QalxU8p(WqQsNNt(0x1e)),QalxU8p(0x3),QalxU8p(0x4),'\x72\x7b\x76\x51\x58\x5e\x78\x4e',QalxU8p(WqQsNNt(0x22)),WqQsNNt(0x8),'\u0024\u004e\u0038\u0029\u006c\u0050\u003b\u0054\u005a\u002f\u007c\u0070\u0043\u006c\u005e\u0075\u0029\u004a\u0067\u0054\u005a\u0046\u002c\u0043\u007d\u0071\u0058\u006e\u0063\u0072\u0050\u007e\u0068\u0058\u0066\u0069\u007d','\x29\x40\x45\x51\x37',QalxU8p(WqQsNNt(0x9)),WqQsNNt(0x8),'\x31\x68\x7a\x65\x61\x2c\x3f\x77\x4f\x4a\x6d\x39\x7b\x34\x79\x3f\x45\x42','\x22\x29\x7a\x65\x51\x3f\x7e\x4c\x72\x47\x6e\x3b\x49\x5e\x6b\x53\x7b\x38\x76\x79\x6e\x72\x4e\x78\x58\x7a\x5e\x4a\x3b\x79\x4f\x54\x22\x3d\x38\x6d\x25\x4b\x57\x2a\x22\x2b','\u0076\u005e\u0072\u0039\u0029\u0066\u0023\u0064\u0029\u0030\u003a',QalxU8p(0x7),'\x7c\x68\x30\x71\x5b\x75\x7b\x4e','f|3Q&;1N',QalxU8p(WqQsNNt(0x1b)),QalxU8p(0x9),'\x32\x4b\x30\x26\x2f\x60\x3d\x45\x26\x55\x66\x53\x56\x43\x60\x64\x3e\x3a\x69\x23\x6e\x70\x7d\x53\x59\x78\x28\x4a\x77\x2f\x69\x4d\x47\x45','\u0078\u0051\u0055\u0058\u007d\u0043\u004b\u0045\u004f\u004a\u0033\u0066\u0062\u006f','\x5e\x62\x49\x6a\x4e\x30\x75\x69\x23\x71\x2b','\x64\x3d\x7a\x65\x58\x5b\x4d\x2b\x3b\x2b\x6d\x21\x42',QalxU8p(0xa),'\x6e\x64\x66\x65\x69\x30\x75','\x7c\x68\x30\x71\x5b\x75\x7b\x4e','\u0023\u004b\u0069\u004e\u0032\u0029\u0075','\u0041\u0068\u0040\u0071\u006e\u005b\u0041\u005f\u0034\u0067\u0070',QalxU8p(WqQsNNt(0x3f)),'\u0071\u0043\u0037\u0060\u0050\u007d\u0069\u0022\u0023\u0078\u0076\u004e\u0064\u0023\u0064\u0041\u0065\u0045',QalxU8p(0xc),QalxU8p(WqQsNNt(0x20)),QalxU8p(WqQsNNt(0xc)),'\x4a\x6b\x31\x24\x34\x26\x41\x55','Rdb&Gka$$U','\x5a\x71\x29\x54\x70\x26\x6d\x74\x4c\x68\x37\x56\x7c\x6a',WqQsNNt(0xf),QalxU8p(0xf),'\x2b\x6a\x68\x66\x24\x70\x7e\x55','qC=lP0XsG(kIE','\x46\x31\x67\x6c\x40\x60\x46\x73\x2c\x73\x37\x5d\x7e\x30\x79\x4b',QalxU8p(0x10),'\x5d\x52\x40\x71\x22\x39\x35','\u0023\u0065\u0077\u002f\u006c\u0059\u0074\u005f','\u0072\u007b\u002b\u0058\u0030\u002e\u0042\u0028\u0059','\x79\x23\x2b\x58\x7d','\u0024\u0072\u0032\u0056\u0059\u004b\u0076\u0041\u0073','\u003a\u006d\u0061\u0028\u0072\u002c\u0071\u0059\u002c\u0031',QalxU8p(0x11),'\x50\x23\x2a\x69\x6b\x71\x76\x4e','\u006d\u007c\u0021\u0028\u004e\u0078\u0070\u004e',WqQsNNt(0xa),'\u002f\u0075\u0043\u0074\u004d\u0063\u0041\u0069\u0040\u005b\u005a\u0060\u0028\u0031\u005f\u002c\u0031\u0059\u0066\u0054\u0068\u0063\u005e\u0033\u0055\u0045\u004d\u0055\u0037\u002b\u0033\u0077\u007e\u0031\u0045\u0064\u0029\u0039\u002b\u006f\u005d\u004c\u0062\u0053\u004e',WqQsNNt(0xb),WqQsNNt(0x10),QalxU8p(0x12),'PoEQ7',QalxU8p(0x13),'\u0055\u006d\u0057\u0028\u0062\u0028\u0032\u003f\u0076\u0031\u003a',QalxU8p(0x14),QalxU8p(0x15),'\x34\x72\x41\x69\x25\x57\x35','\x4d\x23\x56\x51',QalxU8p(0x16),'\x76\x29\x21\x28\x75\x75\x3e\x21\x6e\x5f\x70',QalxU8p(0x17),QalxU8p(WqQsNNt(0x9)),QalxU8p(0x18),WqQsNNt(0xe),WqQsNNt(0xd),QalxU8p(0x19),'\x68\x68\x55\x58\x65\x4b\x7c\x2b\x59','\x60\x22\x24\x75\x76','\x7d\x64\x41\x47\x45\x38\x23\x2a',QalxU8p(0x1a),QalxU8p(WqQsNNt(0x28)),'\x26\x79\x68\x25\x4f','\u0047\u0022\u0067\u0026',QalxU8p(0x1c),'\x46\x4f\x6f\x59\x46\x29\x42\x54\x32\x4c\x59\x3c\x62\x7d\x54',QalxU8p(0x1d),'\x30\x2c\x4e\x25\x3f\x36\x4f\x2a','17V!xh*5[','\u0047\u002c\u006f\u0059\u0066\u0053\u0054\u0021\u007c\u006c','\u0031\u0068\u0055\u0058\u0022\u002c\u0063\u004e\u0065\u0053\u006f\u0077\u0073\u0025\u0057\u0072\u0040
|
|||
|
|
|||
|
// 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
|