mirror of https://github.com/KingRan/KR.git
27 lines
101 KiB
JavaScript
27 lines
101 KiB
JavaScript
|
/*
|
|||
|
活动名称:店铺签到 · 超级无线/超级会员
|
|||
|
活动链接:https://lzkj-isv.isvjd.com/sign/signActivity2?activityId=<活动id>
|
|||
|
https://lzkj-isv.isvjd.com/sign/sevenDay/signActivity?activityId=<活动id>
|
|||
|
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=<活动id>
|
|||
|
https://cjhy-isv.isvjcloud.com/sign/sevenDay/signActivity?activityId=<活动id>
|
|||
|
环境变量:jd_wxSign_sign_lzkj_Ids // 超级无线签到有礼活动id(旧变量 LZKJ_SIGN)
|
|||
|
jd_wxSign_sevenDay_lzkj_Ids // 超级无线7日签到活动id(旧变量 LZKJ_SEVENDAY)
|
|||
|
jd_wxSign_sign_cjhy_Ids // 超级会员签到有礼活动id(旧变量 CJHY_SIGN)
|
|||
|
jd_wxSign_sevenDay_cjhy_Ids // 超级会员7日签到活动id(旧变量 CJHY_SEVENDAY)
|
|||
|
jd_wxSign_lzkjInterval // 自定义超级无线活动签到间隔(整数),默认1秒
|
|||
|
jd_wxSign_cjhyInterval // 自定义超级会员活动签到间隔(整数),默认1秒
|
|||
|
jd_wxSign_lzkjFilter // 账号pin过滤(跳过不跑),多个用户名用@分割
|
|||
|
jd_wxSign_cjhyFilter // 账号pin过滤(跳过不跑),多个用户名用@分割
|
|||
|
jd_wxSign_Notify // 是否推送通知(true/false),默认不推送
|
|||
|
|
|||
|
不同环境变量对应不同链接类型注意区分,环境变量所对应活动类型的排列顺序与链接的排列顺序一致,如果有多个活动ID用英文逗号分割即可实现多活动签到
|
|||
|
|
|||
|
cron: 7 7 7 7 * jd_wxSign.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('店铺签到(超级无线/超级会员)')
|
|||
|
var version_='jsjiami.com.v7';const II11i1l=l1llli1i;(function(IiIlll1l,lIlII1iI,ililIIlI,iiIIliii,iiIlI1lI,lilI1111,Il1l1i1l){return IiIlll1l=IiIlll1l>>0x9,lilI1111='hs',Il1l1i1l='hs',function(lIII11I,liI11Ii1,lllilllI,illl1lll,lI1llII){const iIi1II=l1llli1i;illl1lll='tfi',lilI1111=illl1lll+lilI1111,lI1llII='up',Il1l1i1l+=lI1llII,lilI1111=lllilllI(lilI1111),Il1l1i1l=lllilllI(Il1l1i1l),lllilllI=0x0;const IIlI11ii=lIII11I();while(!![]&&--iiIIliii+liI11Ii1){try{illl1lll=parseInt(iIi1II(0x43c,'RSyk'))/0x1+-parseInt(iIi1II(0x471,'M93S'))/0x2*(-parseInt(iIi1II(0x2f7,'M93S'))/0x3)+parseInt(iIi1II(0x479,'k&z['))/0x4*(parseInt(iIi1II(0x4c3,'NvY)'))/0x5)+-parseInt(iIi1II(0x285,'Yz1!'))/0x6+-parseInt(iIi1II(0x3a2,'C1^!'))/0x7*(-parseInt(iIi1II(0x400,'@cG4'))/0x8)+-parseInt(iIi1II(0x57f,'RSyk'))/0x9+-parseInt(iIi1II(0x393,'S][L'))/0xa;}catch(iiIIilii){illl1lll=lllilllI;}finally{lI1llII=IIlI11ii[lilI1111]();if(IiIlll1l<=iiIIliii)lllilllI?iiIlI1lI?illl1lll=lI1llII:iiIlI1lI=lI1llII:lllilllI=lI1llII;else{if(lllilllI==iiIlI1lI['replace'](/[pPLrxhBQMAODtHbTeXIKV=]/g,'')){if(illl1lll===liI11Ii1){IIlI11ii['un'+lilI1111](lI1llII);break;}IIlI11ii[Il1l1i1l](lI1llII);}}}}}(ililIIlI,lIlII1iI,function(il11li1I,ilil1iII,I11iiII,I1lIlii,Illiliii,Il1l111,illIlIi1){return ilil1iII='\x73\x70\x6c\x69\x74',il11li1I=arguments[0x0],il11li1I=il11li1I[ilil1iII](''),I11iiII=`\x72\x65\x76\x65\x72\x73\x65`,il11li1I=il11li1I[I11iiII]('\x76'),I1lIlii=`\x6a\x6f\x69\x6e`,(0x1401ee,il11li1I[I1lIlii](''));});}(0x18a00,0x6de20,li1iiiI,0xc7),li1iiiI)&&(version_=li1iiiI);const IlIlI1l=$[II11i1l(0x2b0,'Excc')]()?require('./jdCookie'):'',Iiilii1i=require(II11i1l(0x45d,'j[l(')),IIlIl11l=require(II11i1l(0x1c6,'*[VS')),IiiIl=require(II11i1l(0x418,'k&z[')),{wuxian_savePrize:IIi1iiII}=require(II11i1l(0x3e9,'bRkS')),iil1iii1=require(II11i1l(0x20c,'^CKg'));let IlI1il=[];const liiiliI=process[II11i1l(0x257,'S][L')][II11i1l(0x225,'RSyk')]||'',l1l1iIli=process[II11i1l(0x4f3,'yn]D')][II11i1l(0x2d6,'Ilip')]||'',Ill11iii=process[II11i1l(0x4f3,'yn]D')][II11i1l(0x568,'k^]@')]==='true';let I1iIIIIl=(process[II11i1l(0x50a,'Dv)X')][II11i1l(0x20a,'NvY)')]||process['env']['LZKJ_SEVENDAY']||'')[II11i1l(0x414,'ey[7')](','),i1liiilI=(process[II11i1l(0x2b3,'inCd')][II11i1l(0x35f,'yn]D')]||process[II11i1l(0x264,'Yz1!')][II11i1l(0x1bf,'ckv!')]||'')[II11i1l(0x450,'bRkS')](','),i1I11Iii=(process[II11i1l(0x2ae,'A0zo')][II11i1l(0x554,'Dv)X')]||process[II11i1l(0x4d5,'NNte')]['CJHY_SEVENDAY']||'')[II11i1l(0x320,'*[VS')](','),i1iiiI1i=(process[II11i1l(0x5b1,'BTF6')][II11i1l(0x43b,'WaDL')]||process[II11i1l(0x4eb,'yuS$')][II11i1l(0x452,'k^]@')]||'')[II11i1l(0x499,'a7RD')](','),li1I1lI1=(process['env']['jd_wxSign_lzkjFilter']||'')['split']('@'),Ii1iilI=(process['env']['jd_wxSign_cjhyFilter']||'')[II11i1l(0x2b2,'I60q')]('@'),iIllil11='',liliI1Ii={};if($[II11i1l(0x1bd,'M93S')]()){if(JSON[II11i1l(0x4da,'I60q')](process[II11i1l(0x4eb,'yuS$')])['indexOf'](II11i1l(0x346,'*[VS'))>-0x1)process[II11i1l(0x3d2,'Yz1!')](0x0);Object[II11i1l(0x54e,'kVvm')](IlIlI1l)[II11i1l(0x315,'mo6e')](lI1I11I=>{const l1Ii1Ii1=II11i1l;IlI1il[l1Ii1Ii1(0x4d7,'A0zo')](IlIlI1l[lI1I11I]);});if(process['env'][II11i1l(0x5bf,'mo6e')]&&process['env']['JD_DEBUG']===II11i1l(0x543,'eUU$'))console[II11i1l(0x33a,'3SAU')]=()=>{};}else IlI1il=[$[II11i1l(0x38b,'*cWa')](II11i1l(0x49b,'K4#l')),$[II11i1l(0x37c,'^(ED')]('CookieJD2'),...$[II11i1l(0x42d,'@5uG')]($[II11i1l(0x458,'hKoi')](II11i1l(0x355,'@cG4'))||'[]')[II11i1l(0x365,'mo6e')](IllllIii=>IllllIii[II11i1l(0x533,'8a2X')])][II11i1l(0x2ad,'eUU$')](III1iIi=>!!III1iIi);!IlI1il[0x0]&&($['msg']($['name'],II11i1l(0x52b,'RSyk')),process[II11i1l(0x1e9,'A0zo')](0x1));!(async()=>{const iiIiiil=II11i1l,iIilIili={'AsSkw':function(IIilil1l,lilI1i1I){return IIilil1l%lilI1i1I;},'NbUWH':'数据忙','pdkCh':function(ii11iill,i11li1iI){return ii11iill(i11li1iI);},'NKMFI':function(iI11l11i,IlIII111){return iI11l11i*IlIII111;},'ftjcY':function(l1i1i1I1,i1illI1I,i11II1II){return l1i1i1I1(i1illI1I,i11II1II);},'BrcEh':function(l11IilIi,lllIlliI){return l11IilIi+lllIlliI;},'UyamS':function(i1i1llIi,IiIliIi1){return i1i1l
|
|||
|
// 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
|