mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
19 lines
42 KiB
JavaScript
19 lines
42 KiB
JavaScript
|
/*
|
|||
|
活动名称:店铺礼包 · 无线营销
|
|||
|
活动链接:https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/shopGiftBag.html?activityType=<活动类型>&activityId=<活动id>
|
|||
|
环境变量:jd_gzsl_shopGiftBag_activityUrl // 活动链接
|
|||
|
|
|||
|
7 7 7 7 * jd_gzsl_shopGiftBag.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('店铺礼包(无线营销)')
|
|||
|
const notify = $.isNode() ? require('./sendNotify') : ''
|
|||
|
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const i1Iill1l=Il1l1iii;function Il1l1iii(_0x3ce3c9,_0x24c032){const _0x4d24b3=iIIIlI1I();return Il1l1iii=function(_0x3a590f,_0x4a50fa){_0x3a590f=_0x3a590f-0x129;let _0x1a9df5=_0x4d24b3[_0x3a590f];if(Il1l1iii['fsaHXN']===undefined){var _0x1c1e82=function(_0x74f4a9){const _0x4d7c54='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x239fc7='',_0x4d7753='';for(let _0x206bea=0x0,_0x15d91a,_0x4b75ac,_0x1371d1=0x0;_0x4b75ac=_0x74f4a9['charAt'](_0x1371d1++);~_0x4b75ac&&(_0x15d91a=_0x206bea%0x4?_0x15d91a*0x40+_0x4b75ac:_0x4b75ac,_0x206bea++%0x4)?_0x239fc7+=String['fromCharCode'](0xff&_0x15d91a>>(-0x2*_0x206bea&0x6)):0x0){_0x4b75ac=_0x4d7c54['indexOf'](_0x4b75ac);}for(let _0x460a5f=0x0,_0x446476=_0x239fc7['length'];_0x460a5f<_0x446476;_0x460a5f++){_0x4d7753+='%'+('00'+_0x239fc7['charCodeAt'](_0x460a5f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d7753);};Il1l1iii['Resvim']=_0x1c1e82,_0x3ce3c9=arguments,Il1l1iii['fsaHXN']=!![];}const _0x1a7b9a=_0x4d24b3[0x0],_0x359748=_0x3a590f+_0x1a7b9a,_0x2ea70c=_0x3ce3c9[_0x359748];return!_0x2ea70c?(_0x1a9df5=Il1l1iii['Resvim'](_0x1a9df5),_0x3ce3c9[_0x359748]=_0x1a9df5):_0x1a9df5=_0x2ea70c,_0x1a9df5;},Il1l1iii(_0x3ce3c9,_0x24c032);}(function(ll1Ili11,lill1l1I,iiII1Ii1,illIl1iI,IliiI1Il,liIIiI1,iIiIl){return ll1Ili11=ll1Ili11>>0x5,liIIiI1='hs',iIiIl='hs',function(iIi1iIII,liilil1I,iil1l1lI,ilii1III,l1lllI11){const lll1liIi=Il1l1iii;ilii1III='tfi',liIIiI1=ilii1III+liIIiI1,l1lllI11='up',iIiIl+=l1lllI11,liIIiI1=iil1l1lI(liIIiI1),iIiIl=iil1l1lI(iIiIl),iil1l1lI=0x0;const l111liII=iIi1iIII();while(!![]&&--illIl1iI+liilil1I){try{ilii1III=-parseInt(lll1liIi(0x23a))/0x1+parseInt(lll1liIi(0x1b2))/0x2*(parseInt(lll1liIi(0x12d))/0x3)+parseInt(lll1liIi(0x232))/0x4*(-parseInt(lll1liIi(0x22d))/0x5)+parseInt(lll1liIi(0x19f))/0x6+-parseInt(lll1liIi(0x1c8))/0x7+-parseInt(lll1liIi(0x184))/0x8+parseInt(lll1liIi(0x22f))/0x9;}catch(iI1lii1I){ilii1III=iil1l1lI;}finally{l1lllI11=l111liII[liIIiI1]();if(ll1Ili11<=illIl1iI)iil1l1lI?IliiI1Il?ilii1III=l1lllI11:IliiI1Il=l1lllI11:iil1l1lI=l1lllI11;else{if(iil1l1lI==IliiI1Il['replace'](/[kgdenuYWKrTwRNPbpfX=]/g,'')){if(ilii1III===liilil1I){l111liII['un'+liIIiI1](l1lllI11);break;}l111liII[iIiIl](l1lllI11);}}}}}(iiII1Ii1,lill1l1I,function(ll1iI11l,l1l1liII,I11l1ilI,I1l1lilI,I11lI1,Ii1iIli,Iii1l1il){return l1l1liII='\x73\x70\x6c\x69\x74',ll1iI11l=arguments[0x0],ll1iI11l=ll1iI11l[l1l1liII](''),I11l1ilI=`\x72\x65\x76\x65\x72\x73\x65`,ll1iI11l=ll1iI11l[I11l1ilI]('\x76'),I1l1lilI=`\x6a\x6f\x69\x6e`,(0x135e20,ll1iI11l[I1l1lilI](''));});}(0x1820,0xb9570,iIIIlI1I,0xc3),iIIIlI1I)&&(version_=iIIIlI1I);let cookiesArr=[],cookie='',allMessage='',activityUrl=process[i1Iill1l(0x26a)][i1Iill1l(0x1d4)]?process[i1Iill1l(0x26a)][i1Iill1l(0x1d4)]:'';if($[i1Iill1l(0x13f)]()){Object[i1Iill1l(0x15b)](jdCookieNode)[i1Iill1l(0x1d1)](liilillI=>{const l1liIlll=i1Iill1l;cookiesArr[l1liIlll(0x202)](jdCookieNode[liilillI]);});if(process[i1Iill1l(0x26a)][i1Iill1l(0x1b8)]&&process[i1Iill1l(0x26a)][i1Iill1l(0x1b8)]===i1Iill1l(0x16b))console[i1Iill1l(0x1f0)]=()=>{};}else cookiesArr=[$[i1Iill1l(0x229)](i1Iill1l(0x1d2)),$[i1Iill1l(0x229)](i1Iill1l(0x226)),...jsonParse($[i1Iill1l(0x229)](i1Iill1l(0x197))||'[]')[i1Iill1l(0x259)](Il11lIi=>Il11lIi[i1Iill1l(0x12b)])][i1Iill1l(0x179)](Il1lIiI=>!!Il1lIiI);if(activityUrl)activityId=getQueryString(''+activityUrl,i1Iill1l(0x16d)),$[i1Iill1l(0x258)]=activityUrl[i1Iill1l(0x220)](/https?:\/\/([^/]+)/)[0x1],console[i1Iill1l(0x1f0)](i1Iill1l(0x1b0)+activityId+'\x0a'+$[i1Iill1l(0x258)]);else{console[i1Iill1l(0x1f0)](i1Iill1l(0x21d));return;}let domains=i1Iill1l(0x192)+$[i1Iill1l(0x258)];function iIIIlI1I(){const Il1l1ill=(function(){return[...[version_,'WKnjksgwjNuibafmeiT.RcoKPmXYP.pdvre7wdwu==','vwzjC3a','z3f0Bxq','svDIz2S','yxzmwMC','5PYQ5BYa5AEl','BgvUz3rO','tKvYr24','BezeuK0','v2LevKu','zg9TywLU','BwfW','BwzvruK','wK1NBeq','sNnPA3e','zvD5BuK','Dxr2BxG','yxbWBgLJyxrPB24VANnVBJTJAgfYC2v0pvvurI04','tMnbAxC','AgfZrw5K','DMvUzgvYswq','BhbvCvy','svfyrw8','C2vUze5VDgLMEq','EerQBhK','44cq5O+q56s644cr6k+35ywi
|
|||
|
|
|||
|
// 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
|