KR/jd_lzkj_loreal_perfectInfo.js

24 lines
74 KiB
JavaScript
Raw Normal View History

2023-08-05 16:27:38 +08:00
/*
2023-10-16 20:57:18 +08:00
活动名称完善有礼超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10049&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10049&templateId=<模板id>&activityId=<活动id>&prd=cjwx
2023-08-05 16:27:38 +08:00
环境变量jd_lzkj_loreal_perfectInfo_url // 活动链接
2023-10-16 20:57:18 +08:00
jd_lzkj_loreal_perfectInfo_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_perfectInfo_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_perfectInfo_break // 493后继续执行默认退出运行true/false
2023-08-05 16:27:38 +08:00
请使用本地IP环境 请使用本地IP环境 请使用本地IP环境
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-10-16 20:57:18 +08:00
#完善有礼超级无线
1 1 1 1 * jd_lzkj_loreal_perfectInfo.js, tag=完善有礼超级无线, enabled=true
2023-08-05 16:27:38 +08:00
2023-10-16 20:57:18 +08:00
*/
2023-08-05 16:27:38 +08:00
2023-10-16 20:57:18 +08:00
const $ = new Env('完善有礼(超级无线)')
var version_='jsjiami.com.v7';const Iil1iIi=li11iiil;(function(Ilill1,llIiIlI1,Iii1IIii,i1ili11i,ili1iIi1,i1IliIii,IllIliiI){return Ilill1=Ilill1>>0x8,i1IliIii='hs',IllIliiI='hs',function(llI1l1ll,iIiIlll1,I1i111li,I111II1,lliIliIi){const ll1lIl11=li11iiil;I111II1='tfi',i1IliIii=I111II1+i1IliIii,lliIliIi='up',IllIliiI+=lliIliIi,i1IliIii=I1i111li(i1IliIii),IllIliiI=I1i111li(IllIliiI),I1i111li=0x0;const li1ill1=llI1l1ll();while(!![]&&--i1ili11i+iIiIlll1){try{I111II1=parseInt(ll1lIl11(0x384,'@g^3'))/0x1+parseInt(ll1lIl11(0x272,'%j*l'))/0x2+parseInt(ll1lIl11(0xb0,'QvpV'))/0x3+parseInt(ll1lIl11(0x32f,'109D'))/0x4+-parseInt(ll1lIl11(0x354,'ce03'))/0x5*(-parseInt(ll1lIl11(0x286,'8mVN'))/0x6)+parseInt(ll1lIl11(0x83,']*#B'))/0x7+-parseInt(ll1lIl11(0x1c7,'8mVN'))/0x8;}catch(iI1iIIII){I111II1=I1i111li;}finally{lliIliIi=li1ill1[i1IliIii]();if(Ilill1<=i1ili11i)I1i111li?ili1iIi1?I111II1=lliIliIi:ili1iIi1=lliIliIi:I1i111li=lliIliIi;else{if(I1i111li==ili1iIi1['replace'](/[HJghGkMRKOYfdAwlBurtC=]/g,'')){if(I111II1===iIiIlll1){li1ill1['un'+i1IliIii](lliIliIi);break;}li1ill1[IllIliiI](lliIliIi);}}}}}(Iii1IIii,llIiIlI1,function(l11llllI,IIIII11I,lIil1IiI,illlIi1I,l1ii11l,IiliiIl1,illI1lil){return IIIII11I='\x73\x70\x6c\x69\x74',l11llllI=arguments[0x0],l11llllI=l11llllI[IIIII11I](''),lIil1IiI=`\x72\x65\x76\x65\x72\x73\x65`,l11llllI=l11llllI[lIil1IiI]('\x76'),illlIi1I=`\x6a\x6f\x69\x6e`,(0x142db1,l11llllI[illlIi1I](''));});}(0xc100,0xf39fc,i1Iill11,0xc3),i1Iill11)&&(version_=i1Iill11);const illl11l=require('./jdCookie'),l1iii1i=require(Iil1iIi(0x35e,'E8MC')),IlIIil11=require('./function/sendJDNotify'),iIIiI1i=require(Iil1iIi(0x375,'jBZs')),{loreal_savePrize:l1Iii1li}=require('./function/krsavePrize'),li11l1li=process[Iil1iIi(0x182,'3aBA')]['jd_lzkj_loreal_perfectInfo_url']||'',iil1iiii=process[Iil1iIi(0xd8,'8mVN')][Iil1iIi(0x389,'@g^3')]===Iil1iIi(0x348,'Ceda'),II11l1ll=process[Iil1iIi(0x2ac,'vSFh')]['jd_lzkj_loreal_perfectInfo_break']===Iil1iIi(0x2e1,']c61'),liliiI1l=process[Iil1iIi(0x2a3,']c61')]['jd_lzkj_loreal_perfectInfo_Notify']===Iil1iIi(0x12d,'PPH)');let l1IIiill='',I1iliIIl='';const I1i1iI=Object[Iil1iIi(0x2d9,'EIUX')](illl11l)[Iil1iIi(0xbb,'rGvA')](I11lIlII=>illl11l[I11lIlII])['filter'](lii11ilI=>lii11ilI);!I1i1iI[0x0]&&($[Iil1iIi(0xcc,'EIUX')]($[Iil1iIi(0xac,'7s7X')],Iil1iIi(0x207,'FK[h')),process[Iil1iIi(0xe9,'@g^3')](0x1));!(async()=>{const lIl111i1=Iil1iIi,Il1I1ii={'aJRhA':'⚠\x20请先定义必要的环境变量后再运行脚本','xCKoD':lIl111i1(0x1ad,'xkaJ'),'vVdbR':'activityId','DTRnK':'activityType','NIZer':lIl111i1(0x1cb,'mJg^'),'QmaGM':lIl111i1(0x196,'dmNb'),'HXspI':'活动入口:','bmsBu':function(i1lliii,Ill1l11){return i1lliii<Ill1l11;},'ZIoXJ':function(iiI11il1,iIl1liii){return iiI11il1+iIl1liii;},'pZiXP':lIl111i1(0x351,'rGvA'),'YuICw':lIl111i1(0x165,'H(Iu'),'CZWNF':function(l1Ii1iI,l1l11l1l){return l1Ii1iI+l1l11l1l;},'deCKy':function(I1ii1iI1,iiiIIIII){return I1ii1iI1*iiiIIIII;},'MODPZ':function(iI11llli){return iI11llli();}};if(!li11l1li){console[lIl111i1(0x28e,']c61')](Il1I1ii['aJRhA']);return;}const IIl1lii=l1iii1i[lIl111i1(0x2dd,'EksT')](li11l1li);if(!IIl1lii){console[lIl111i1(0xb2,'E8MC')](Il1I1ii['xCKoD']);return;}$[lIl111i1(0x186,'g#Bg')]=li11l1li,$[lIl111i1(0x247,'PPH)')]=l1iii1i[lIl111i1(0x38d,']c61')](li11l1li,Il1I1ii[lIl111i1(0x25f,'8mVN')]),$[lIl111i1(0x2da,'7s7X')]=l1iii1i['getUrlParameter'](li11l1li,Il1I1ii[lIl111i1(0x37e,'7s7X')]),$[lIl111i1(0x1e7,']c61')]=IIl1lii[lIl111i1(0x1b9,'7%KO')],$[lIl111i1(0x2e0,'W(Jv')]=IIl1lii[lIl111i1(0x3a1,'vSFh')];let i1I1iiI='';if($[lIl111i1(0x378,'D]^o')]){if($[lIl111i1(0x221,'^OHw')]['includes'](lIl111i1(0xf9,'PPH)')))i1I1iiI=Il1I1ii['NIZer'];else $[lIl111i1(0x310,'M$pU')]['includes'](lIl111i1(0x215,'7s7X'))&&(i1I1iiI=$['pathname'][lIl111i1(0x2c3,'cz%U')](/\/index$/,''));$['baseUrl']=lIl111i1(0x2e3,'E8MC')+$['hostname'],$['newbaseUrl']=lIl111i1(0x17b,'8mVN')+$['hostname']+'/'+i1I1iiI,$['origin']=$[lIl111i1(0x108,'oT@7')];}if(!$['activityId']||!i1I1iiI||!$['hostname']){console[lIl111i1(0x28e,']c61')](Il1I1ii['QmaGM']);return;}IlIIil11[lIl111i1(0x2d2,'iK$J')]({'titl
2023-08-05 16:27:38 +08:00
// prettier-ignore
2023-10-16 20:57:18 +08:00
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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])