mirror of https://github.com/KingRan/KR.git
21 lines
89 KiB
JavaScript
21 lines
89 KiB
JavaScript
|
/*
|
|||
|
活动名称:店铺签到 · 超级无线/超级会员/lorealjdcampaign
|
|||
|
活动链接:https://lzkj-isv.isvjd.com/sign/sevenDay/signActivity?activityId=<活动id>
|
|||
|
https://lzkj-isv.isvjd.com/sign/signActivity2?activityId=<活动id>
|
|||
|
https://cjhy-isv.isvjcloud.com/sign/sevenDay/signActivity?activityId=<活动id>
|
|||
|
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=<活动id>
|
|||
|
https://lorealjdcampaign-rc.isvjcloud.com/prod/cc/cjwx/sign/signActivity2?activityId=<活动id>
|
|||
|
环境变量:
|
|||
|
jd_shopSign_activityUrl // 活动链接
|
|||
|
jd_shopSign_joinMember // 是否入会(true/false),默认不入会
|
|||
|
|
|||
|
此脚本主要监控使用
|
|||
|
|
|||
|
cron: 7 7 7 7 7 jd_shopSign.js
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('无线店铺签到(超级无线/超级会员)')
|
|||
|
var version_='jsjiami.com.v7';const liii=iii1II;function iii1II(_0xa82df8,_0x9eb908){const _0x88447f=Iii11l();return iii1II=function(_0x34248b,_0x55b701){_0x34248b=_0x34248b-0x1d9;let _0x1f1a45=_0x88447f[_0x34248b];if(iii1II['ycUCmV']===undefined){var _0x9812b7=function(_0x4e664a){const _0x1fc069='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x37c3bb='',_0x2070e9='';for(let _0x2a4745=0x0,_0x58ea2f,_0x415bf8,_0x2ad6fb=0x0;_0x415bf8=_0x4e664a['charAt'](_0x2ad6fb++);~_0x415bf8&&(_0x58ea2f=_0x2a4745%0x4?_0x58ea2f*0x40+_0x415bf8:_0x415bf8,_0x2a4745++%0x4)?_0x37c3bb+=String['fromCharCode'](0xff&_0x58ea2f>>(-0x2*_0x2a4745&0x6)):0x0){_0x415bf8=_0x1fc069['indexOf'](_0x415bf8);}for(let _0x15c402=0x0,_0x22c4c7=_0x37c3bb['length'];_0x15c402<_0x22c4c7;_0x15c402++){_0x2070e9+='%'+('00'+_0x37c3bb['charCodeAt'](_0x15c402)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2070e9);};const _0x29704a=function(_0x35c6eb,_0x1b9140){let _0x46db9a=[],_0x39ad35=0x0,_0x5ad836,_0x58bdf8='';_0x35c6eb=_0x9812b7(_0x35c6eb);let _0x31bb5b;for(_0x31bb5b=0x0;_0x31bb5b<0x100;_0x31bb5b++){_0x46db9a[_0x31bb5b]=_0x31bb5b;}for(_0x31bb5b=0x0;_0x31bb5b<0x100;_0x31bb5b++){_0x39ad35=(_0x39ad35+_0x46db9a[_0x31bb5b]+_0x1b9140['charCodeAt'](_0x31bb5b%_0x1b9140['length']))%0x100,_0x5ad836=_0x46db9a[_0x31bb5b],_0x46db9a[_0x31bb5b]=_0x46db9a[_0x39ad35],_0x46db9a[_0x39ad35]=_0x5ad836;}_0x31bb5b=0x0,_0x39ad35=0x0;for(let _0x39c9d1=0x0;_0x39c9d1<_0x35c6eb['length'];_0x39c9d1++){_0x31bb5b=(_0x31bb5b+0x1)%0x100,_0x39ad35=(_0x39ad35+_0x46db9a[_0x31bb5b])%0x100,_0x5ad836=_0x46db9a[_0x31bb5b],_0x46db9a[_0x31bb5b]=_0x46db9a[_0x39ad35],_0x46db9a[_0x39ad35]=_0x5ad836,_0x58bdf8+=String['fromCharCode'](_0x35c6eb['charCodeAt'](_0x39c9d1)^_0x46db9a[(_0x46db9a[_0x31bb5b]+_0x46db9a[_0x39ad35])%0x100]);}return _0x58bdf8;};iii1II['mqmRKy']=_0x29704a,_0xa82df8=arguments,iii1II['ycUCmV']=!![];}const _0x37e7e7=_0x88447f[0x0],_0x31035d=_0x34248b+_0x37e7e7,_0x4314e5=_0xa82df8[_0x31035d];return!_0x4314e5?(iii1II['wybfNr']===undefined&&(iii1II['wybfNr']=!![]),_0x1f1a45=iii1II['mqmRKy'](_0x1f1a45,_0x55b701),_0xa82df8[_0x31035d]=_0x1f1a45):_0x1f1a45=_0x4314e5,_0x1f1a45;},iii1II(_0xa82df8,_0x9eb908);}function Iii11l(){const iiilIl=(function(){return[version_,'NXUjEqsjrTifaGAmui.kcVotm.SYYvtF7nRurxVl==','BCkKWP3dPmoX','i1tdLbrTWP0','k0/cHNNcU8kJWOO6','W58yfaT8','WP3cTutcRN8','ErZdSmojW7LhoHRcG1rRWR9H','WRPLfmkzed8dhbBdJSkHtmoe','WR9ldmkvnq','WQ3cTfFdKrC','WPPYn8oAWQtdR1tdLq','CSoNyx3dV8kgW4qSgrC+W6i','FrhdLZZdJCo3W5CXWR7dUcH9Eq','FCoBtCoDrW','poAjN+s4LCkN','oX7dQSo4W6u','WR3cJKdcQKm','q1/dLNuw','WQFcMMRcV3K','pCkxtbGnnJNdTJHBWOr1','W6jemYXRWROkWQLLW5pdVfHSq8khWRJcMmoNeWXtW7XSw8ksqCoAW7tcItmVgmoTW6LNzhq3WPnGWRNdKg0cW6lcMHK','FL4+uSoJ','tmkyWPi','44cd5lIO5lIj6lsY5y2+','h8krCmkBDG','kJxdK8osW4G','BCoJWQBcSq','iY3dLCoXW5H7gdhcV2HaW4iKc8oTmCkCqu0EW4PAW7CNfmo5W7ZdUIuwW5iroG','ymoUWQhcTrdcKSkItg3cKComwuHneNRdOSkoWRFcUmoCWOTgEt/cQSk5BhlcOG3cKmkCW6hcRCogcCk3W4xdMSoWW5RdSuvjyYhcKCkEWQHkW4pcGeNdR8kJhLpcRJNdNwlcIbNcVJb6mGlcL1ldUmkTjJ/cMsVdP8koWOtcQCkhW74DCSoyc8k1umkEWPhdJmo9lmooxKD8W6tcLmoystLQEJVdMmoeWOxdKhpcQN3dVc98W7hdV8ocWOq6iIi8DmoZW584W7OjeH1rWOPeWRmxh8oNWRdcOmkrASk/WPRdLtugWQ3cKICHWQCMWQVdQrpdH8onnG','W7LzidjkW6vwW7nQW40','5Q6KWPLW5BwO6ko16zUT5yMy77Yf6k636l6YW4Se5yQc6zob5zc05ysU5OM46kcI6iwy5PYn776/','W6xcN1NdVcbHwhOMtq','hCkBWQ4HkG','WOXRdG','WOnjjmk8drS8jG','smksWOmauW','W7mFdZTwWOZcTCkLWOVcLmkPlG','WQuGm8kOaq','W48sbc9d','WQFdM8kmnSox','WRrVimkKWP15W7tcPwvhW55pW6noW5OknSoLkI1Quq','6i235B2N77YA','saxcSwue','WPRdPmkGjCodfCkAWPRcQG','WPKGldu9C3O','uxGxv8oeWPRdTKe','WPRdJ8oHWO7cHq','n8oAbCoSkwFdMSol','WPJdI8oGWOJcJbC','W6xcN1NdVcbHwhOIrGGX','44ot5lQ75lMV6lER5yYn','F8kjWR7dPmoeW4PcW48btSk0WOO','kSkfCSkUuCkP','W6z4W4VdGcG','CComE8k6WPO','W79xW5ZdPW/dJ059','ECoVWQpcTWxdNCkBDwS','n8ogW6rOqmoJWPHD','amoFiCoKhG','k0ZdHHPS','c2/dTWbR','W5DrW43dOqddMNnXaq','F8oCW6T7z8kIWO1xkd0lWQeaAmomW4eKW6iPWQNdR8oJW67cTq','smodWPxcVbK','W7LakZvS','W6BcGgNdTgm','t1BcVfRcGW','WQtdSMtdNgm','6Ag56kEt5zQV54UP77+Q','DmkuW4eWcW','xSoEzSoi','jvHeFG','oCobW6fWFmoPWPTb','WQNcNNpdRZJdMWDQkrdcLea'
|
|||
|
// 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.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"])
|