KR/jd_lzkj_loreal_perfectInfo.js

21 lines
92 KiB
JavaScript
Raw Normal View History

2023-08-05 16:27:38 +08:00
/*
活动名称完善有礼超级无线欧莱雅
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10049&templateId=<模板id>&activityId=<活动id>&nodeId=<nodeid>&prd=cjwx
https://lorealjdcampaign-rc.isvjcloud.com/interact/index?activityType=10049&templateId=<模板id>&activityId=<活动id>&nodeId=<nodeid>&prd=cjwx
支持activityType (10049)
环境变量jd_lzkj_loreal_perfectInfo_url // 活动链接
请使用本地IP环境 请使用本地IP环境 请使用本地IP环境
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#lzkj_loreal完善有礼
1 1 1 1 * jd_lzkj_loreal_perfectInfo.js, tag=lzkj_loreal完善有礼, enabled=true
*/
const $ = new Env("完善有礼lzkj_loreal");
var version_='jsjiami.com.v7';const IIilIl=iii1II;(function(lI11l,iI1Il,i111il,i111ii,lI11i,ilI11,li1llI){return lI11l=lI11l>>0x9,ilI11='hs',li1llI='hs',function(lIil11,iIilII,lIlI1,lIllI1,Ill1){const lIllII=iii1II;lIllI1='tfi',ilI11=lIllI1+ilI11,Ill1='up',li1llI+=Ill1,ilI11=lIlI1(ilI11),li1llI=lIlI1(li1llI),lIlI1=0x0;const lI1i1i=lIil11();while(!![]&&--i111ii+iIilII){try{lIllI1=parseInt(lIllII(0x58c,'XB)j'))/0x1+-parseInt(lIllII(0x326,'w6&Q'))/0x2+parseInt(lIllII(0x2a6,'ipho'))/0x3+-parseInt(lIllII(0x2f1,'GLUf'))/0x4+parseInt(lIllII(0x484,'rzW2'))/0x5+-parseInt(lIllII(0x291,'13Wo'))/0x6+parseInt(lIllII(0x327,'r)Ek'))/0x7;}catch(il1IiI){lIllI1=lIlI1;}finally{Ill1=lI1i1i[ilI11]();if(lI11l<=i111ii)lIlI1?lI11i?lIllI1=Ill1:lI11i=Ill1:lIlI1=Ill1;else{if(lIlI1==lI11i['replace'](/[ywxIkPFQSNgBMKfndE=]/g,'')){if(lIllI1===iIilII){lI1i1i['un'+ilI11](Ill1);break;}lI1i1i[li1llI](Ill1);}}}}}(i111il,iI1Il,function(il1Ii1,lI1i1l,li1ll1,iI1II,lIil1I,IiIIII,i111iI){return lI1i1l='\x73\x70\x6c\x69\x74',il1Ii1=arguments[0x0],il1Ii1=il1Ii1[lI1i1l](''),li1ll1='\x72\x65\x76\x65\x72\x73\x65',il1Ii1=il1Ii1[li1ll1]('\x76'),iI1II='\x6a\x6f\x69\x6e',(0x137de4,il1Ii1[iI1II](''));});}(0x18c00,0x4c501,Iii11l,0xc8),Iii11l)&&(version_=Iii11l);const iIIIiI=$[IIilIl(0x505,'v[oj')]()?require(IIilIl(0x4f9,'*1]c')):'',li1iI=$[IIilIl(0x466,'GVdW')]()?require('./jdCookie.js'):'',I1IIi1=require(IIilIl(0x251,'GLUf')),ll1lI1=require('./function/krh5st'),II1ll=require(IIilIl(0x4f7,'hbYK'));let liii11={},lIiIii=process[IIilIl(0x20e,'hbYK')][IIilIl(0x593,'hbYK')],i1Ill=null,Il1I11='',lIl1II='';$[IIilIl(0x353,'gfs7')]=![];let Ii1Ili=null,IIiI11=[],Ii1Ill='',ll1Iii='',IIlII1='';if($['isNode']()){if(JSON[IIilIl(0x42f,'eSeI')](process[IIilIl(0x288,'Y$tw')])['indexOf'](IIilIl(0x409,'GH79'))>-0x1)process[IIilIl(0x24f,'Qx0x')](0x0);Object['keys'](li1iI)['forEach'](IIiI1l=>{IIiI11['push'](li1iI[IIiI1l]);});if(process['env']['JD_DEBUG']&&process[IIilIl(0x4c9,'YC3K')][IIilIl(0x2ee,'eSeI')]===IIilIl(0x56c,'%2d['))console['log']=()=>{};}else IIiI11=[$['getdata'](IIilIl(0x470,']ztl')),$[IIilIl(0x489,'hbYK')]('CookieJD2'),...$[IIilIl(0x404,'13Wo')]($[IIilIl(0x299,']neD')](IIilIl(0x4be,'0r&q'))||'[]')[IIilIl(0x278,'rzW2')](IIiI1i=>IIiI1i[IIilIl(0x362,'w2Et')])][IIilIl(0x43c,'z4bh')](ilIllI=>!!ilIllI);let ll1Iil=typeof $request!==IIilIl(0x280,'$9$M');ll1Iil&&(GetCookie(),$[IIilIl(0x2fe,'YAEK')]());if(lIiIii){const I1IIli=IIilIl(0x3fe,'CK)@')['split']('|');let Il1I1i=0x0;while(!![]){switch(I1IIli[Il1I1i++]){case'0':activityType=iliiil(''+lIiIii,'activityType');continue;case'1':i1Ill=iliiil(''+lIiIii,'activityId');continue;case'2':if(lIiIii['includes'](IIilIl(0x348,'Y$tw')))wxActType='apps/interact';else lIiIii[IIilIl(0x571,'GhJ[')](IIilIl(0x31f,'$9$M'))?wxActType=lIiIii[IIilIl(0x337,'$87#')](/\/(prod\/cc\/interact\w*)\//)[0x1]:console[IIilIl(0x243,'w6&Q')](IIilIl(0x43e,'v[oj'));continue;case'3':$['domain']=lIiIii[IIilIl(0x305,'hbYK')](/https?:\/\/([^/]+)/)[0x1];continue;case'4':templateId=iliiil(''+lIiIii,'templateId');continue;}break;}}let li1lI=IIilIl(0x2d9,'XB)j')+$[IIilIl(0x45f,'eSeI')];!(async()=>{const IIilIi=IIilIl,lIilI1={'GCLSR':function(Ii1Il1,iIIIli){return Ii1Il1||iIIIli;},'amcdl':'abcdef0123456789','vsdxo':function(I1IIll,i1Ii1){return I1IIll<i1Ii1;},'qDsMV':function(lIilII,ilIlli){return lIilII*ilIlli;},'weJZh':function(I1IIlI,ilIlll){return I1IIlI>ilIlll;},'idIXj':'GITHUB','ZxmNp':IIilIi(0x2b3,'GVdW'),'AlvCk':function(Ii1Iii){return Ii1Iii();},'flRbM':'此ip已无法开卡请更换IP后再执行脚本\x0a','zGnvH':function(Ii1Iil,ll1IiI){return Ii1Iil+ll1IiI;},'BSfAe':IIilIi(0x266,'lNsj'),'JDnYa':IIilIi(0x5b3,'*1]c'),'oCtit':'=([^&]*)(&|$)','KKnft':function(li1li,iIIIll){return li1li(iIIIll);},'aezQy':function(ll1Ii1,li1ll){return ll1Ii1==li1ll;},'gHTIk':'活动入口:','bsZSl':IIilIi(0x42b,'rzW2'),'KsXES':IIilIi(0x4d7,'GLUf'),'iqiJL':IIilIi(0x504,'lt[n'),'Wlhzx':function(iliii1,i1IiI){return iliii1!=i1IiI;},'vSWjT':function(lIllil,iilIi1){return lIllil!==iilIi1;},'pbdWs':function(I111,I1I11l){return I111!=I1I11l;},'Ekquj':IIilIi(0x2e4,'%2d['),'gOabS':IIilIi(0x50
// 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