mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-13 22:24:45 +08:00
15 lines
71 KiB
JavaScript
15 lines
71 KiB
JavaScript
|
/*
|
|||
|
活动名称:一键价保
|
|||
|
环境变量:jd_price_interval // 自定义运行间隔时长(整数,单位毫秒),默认1500
|
|||
|
jd_price_notify // 是否推送通知(true/false),默认不推送
|
|||
|
jd_price_pinFilter // 账号pin过滤,多个用@进行分割
|
|||
|
|
|||
|
cron:55 12 * * *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('一键价保')
|
|||
|
function WS5ZH2(){}var uEQLQJ=Object['defineProperty'],B04k2e1,vleTo8w,YYugY_N,OafT536,RytzGLj,Z4cQ1r,yxhdAyq,hLEyzLz,lACOOaJ,pkd8lt5,L9LXXF,qw9ow3,z_yThI,xxvOoD,CfqymxH,NTTKU8,_z0ebZ,vQZE7G,diT98Ll;function xPiDyd(WS5ZH2){return B04k2e1[WS5ZH2>0x4?WS5ZH2>0x4c?WS5ZH2+0x5d:WS5ZH2<0x4c?WS5ZH2-0x5:WS5ZH2+0x60:WS5ZH2-0x46]}WS5ZH2(B04k2e1=IxmGDn(),vleTo8w=Z5sFsgq((WS5ZH2,uEQLQJ)=>{return uEQLQJ(WS5ZH2())},0x2)(CcaomL,JVBI8dn));var FmkrjH=[],V5re1l2=['\x70\x4b\x6d\x31\x5a\x39\x36\x45','|BR^}7{Z','\u0052\u0030\u0055\u0038\u0021',ShZ4jOf(xPiDyd(0xc)),')o5>%g@jLNU%837}FuWLb',ShZ4jOf(xPiDyd(0xb)),'"47co',ShZ4jOf(0x2),'\x29\x6f\x35\x3e\x25\x67\x40\x6a\x4c\x4e\x6a\x42\x70\x2c\x4f\x60\x79\x2a\x75','\u0072\u0022\u0053\u0032\u007b',')o5>%g@jLNuwv|I+rDe2ygX',ShZ4jOf(xPiDyd(0x18)),'x6@Jb','\u005f\u0063\u0067\u0054',ShZ4jOf(xPiDyd(0x11)),ShZ4jOf(0x5),ShZ4jOf(0x6),'\x34\x31\x28\x48\x23\x55\x22\x59\x6c\x62\x66\x2e\x72\x23\x2a\x73\x48\x45\x4d\x59\x6c\x33\x67\x72\x7b\x43\x32\x78\x44\x7d\x55\x6e\x36\x32\x3a\x57\x7b','\u0048\u0077\u002b\u0054\u0021','\u0069\u005e\u0028\u0047\u0055\u002f\u002b\u0031',ShZ4jOf(0x7),ShZ4jOf(0x6),ShZ4jOf(0x8),'\x38\x73\x25\x66\x74',ShZ4jOf(xPiDyd(0x19)),ShZ4jOf(0xa),ShZ4jOf(xPiDyd(0x10)),ShZ4jOf(xPiDyd(0xe)),ShZ4jOf(0xd),ShZ4jOf(xPiDyd(0x1a)),ShZ4jOf(0xf),'\x6d\x72\x47\x35\x64\x37\x2b\x51\x3d\x7a\x54\x45\x70\x64\x43\x54\x60\x30\x4c\x3a\x49\x24\x25\x78\x5f\x4b\x22\x4d\x55\x23\x5e\x2e\x40\x21\x2a\x46\x4c\x6e\x69\x7e\x54\x31\x3e\x3f\x50\x63\x41\x73\x53\x7b\x30\x34\x46',xPiDyd(0x5),'\x31\x63\x55\x32\x7b','\u007a\u0036\u0037\u0038\u003b\u0067\u0079\u005b\u0056\u0045\u0047\u0039\u0069\u002c\u004b\u0079\u002b\u005f',ShZ4jOf(xPiDyd(0x1c)),'\u007b\u0036\u0072\u003e\u0068\u0048\u0056\u0053\u0050\u006a\u004d\u0041\u0045\u0073\u0023\u006e\u0034\u0069\u0029\u0057\u0022\u0043\u003f\u003f\u0036\u0037',ShZ4jOf(0x11),ShZ4jOf(0x12),'\x3f\x3c\x6a\x32\x2e\x43\x7a\x31',xPiDyd(0x6),ShZ4jOf(xPiDyd(0x1d)),'z6e2x*`jvNaA_','\x21\x36\x67\x54\x5b\x77\x62\x3f\x24',ShZ4jOf(0x14),xPiDyd(0x5),ShZ4jOf(0x15),'z6wCxJ?k,M4Wi,iy8_',ShZ4jOf(0x16),ShZ4jOf(0x17),ShZ4jOf(xPiDyd(0x22)),'\u0045\u0022\u0029\u0057\u0043\u0073\u0042\u0031',xPiDyd(0x6),'\x2c\x7d\x65\x3e\x50\x70\x3f\x3f\x69\x42',ShZ4jOf(0x19),'\u0042\u0065\u006b\u0036\u006c\u0032\u0041\u005e\u0035\u0056\u0042\u0048\u004c\u0079\u0053\u0073\u007c\u0037\u0071\u0071\u003a\u0055\u0065\u0038\u0065\u0049\u0033\u0071\u0077\u004e\u0025\u0051\u0033\u002b\u0072\u003c\u0025\u002a\u002c\u0059\u0055','\u0035\u005e\u003e\u0054','\u007a\u0036\u0065\u0032\u0022\u0043\u005f\u0050\u0029\u006b\u003a\u0063\u0060\u007c\u0074\u007d\u0034\u007d\u0037\u0038','\x7b\x36\x72\x3e\x68\x48\x56\x53\x50\x6a\x4d\x41\x45\x73\x23\x6e\x34\x69\x29\x57\x22\x43\x3f\x3f\x36\x37','\u006f\u007c\u0060\u003c\u0055','\u007a\u0036\u0037\u0038\u007b\u004a\u0070\u0041\u0029\u006b\u0047\u0039\u0069\u002c\u004b\u0079\u002b\u005f','\u007b\u005e\u007c\u0054\u003f\u002a\u0070\u0067\u0024',xPiDyd(0x5),ShZ4jOf(0x19),'/]~`#U|`ki?GP$@',ShZ4jOf(xPiDyd(0x23)),'\u004a\u004e\u0035\u0058\u0032','\x7a\x36\x6a\x32\x68\x34\x58','\x71\x44\x73\x47\x44\x4a\x28\x76\x2e\x4d\x50\x41\x68\x60\x2a\x60\x25\x5e\x6a\x43\x4b\x2a\x6e\x5f\x3a\x6a\x3a\x67\x4d\x69\x50\x7d\x55\x5f','\u0057\u003c\u0066\u004c\u0055\u0061\u0028\u0053\u0024','\x57\x3c\x66\x4c\x64\x34\x7c\x68\x5d\x42\x77\x39\x5f',ShZ4jOf(0x1b),'\x2c\x7d\x30\x32\x79\x67\x2e\x31',xPiDyd(0x5),'\x69\x5e\x28\x47\x55\x2f\x30\x53\x4a\x6d\x7e\x53\x6b\x72\x53\x29\x40\x7d\x5b\x4c\x23\x73\x58',xPiDyd(0x9),ShZ4jOf(0x1c),'Uc+T;0ySS@','\u0055\u0063\u002b\u0054\u0021','Uc+T;0ySS@','\u0069\u005e\u003f\u0057\u007b',ShZ4jOf(xPiDyd(0x24)),'\x30\x48\x3c\x29\x4e',ShZ4jOf(0x1e),ShZ4jOf(xPiDyd(0x7)),ShZ4jOf(xPiDyd(0xd)),'\x21\x36\x76\x38\x44\x4a\x4b\x6a\x43\x4e\x59\x41\x53\x29\x2b\x44\x7a\x36\x75','5^>T',ShZ4jOf(xPiDyd(0x8)),ShZ4jOf(xPiDyd(0x26)),ShZ4jOf(0x22),ShZ4jOf(0x23),ShZ4jOf(0x24),'\x37\x24\x5d\x65\x50\x43\x66\x51','hRTG',ShZ4jOf(0x25),'\u0021\u0036\u0076\u0038\u0044\u004a\u004b\u006a\u0043\u004e\u0059\u0041\u0053\u0029\u002b\u0044\u007a\u0036\u0075',xPiDyd(0x5),'\x61\x7d\x78\x57\x6c\x34\x59\x31\x4f\x6b\x32\x42\x30\x29\x66\x79\x51\
|
|||
|
// 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
|