KR/jd_jinggeng_showDrawOne.js

17 lines
82 KiB
JavaScript
Raw Normal View History

2023-07-28 10:10:43 +08:00
/*
活动名称大转盘抽奖 · 京耕
活动链接https://jinggeng-isv.isvjcloud.com/ql/front/showDrawOne?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_showDrawOne_activityUrl // 活动链接
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#大转盘抽奖
1 1 1 1 * jd_jinggeng_showDrawOne.js, tag=大转盘抽奖, enabled=true
*/
const $ = new Env('大转盘抽奖(京耕)')
2023-07-28 10:29:22 +08:00
var version_='jsjiami.com.v7';const i1IlIi=iii1II;(function(l11liI,li11Ii,lIiIII,i1i,I1Il1l,I1Il1i,i1l){return l11liI=l11liI>>0x9,I1Il1i='hs',i1l='hs',function(IlIiII,iIliI,i1IlII,ilIii1,ll1III){const l11llI=iii1II;ilIii1='tfi',I1Il1i=ilIii1+I1Il1i,ll1III='up',i1l+=ll1III,I1Il1i=i1IlII(I1Il1i),i1l=i1IlII(i1l),i1IlII=0x0;const ll1II1=IlIiII();while(!![]&&--i1i+iIliI){try{ilIii1=parseInt(l11llI(0xd7,'t%Dx'))/0x1+parseInt(l11llI(0xec,'rU(4'))/0x2+parseInt(l11llI(0x209,'6MtV'))/0x3+-parseInt(l11llI(0x303,'^B)D'))/0x4*(-parseInt(l11llI(0x1dc,'9&lS'))/0x5)+parseInt(l11llI(0x270,'^B)D'))/0x6*(parseInt(l11llI(0x253,'O#uA'))/0x7)+-parseInt(l11llI(0x313,'TIfq'))/0x8+-parseInt(l11llI(0xc2,'mlS#'))/0x9;}catch(l11lii){ilIii1=i1IlII;}finally{ll1III=ll1II1[I1Il1i]();if(l11liI<=i1i)i1IlII?I1Il1l?ilIii1=ll1III:I1Il1l=ll1III:i1IlII=ll1III;else{if(i1IlII==I1Il1l['replace'](/[gfYwIWLMSeuQkynRB=]/g,'')){if(ilIii1===iIliI){ll1II1['un'+I1Il1i](ll1III);break;}ll1II1[i1l](ll1III);}}}}}(lIiIII,li11Ii,function(IIlIii,l11lil,iIllli,iIlll1,ilIiiI,I1Il1I,IIlIil){return l11lil='\x73\x70\x6c\x69\x74',IIlIii=arguments[0x0],IIlIii=IIlIii[l11lil](''),iIllli='\x72\x65\x76\x65\x72\x73\x65',IIlIii=IIlIii[iIllli]('\x76'),iIlll1='\x6a\x6f\x69\x6e',(0x1368b4,IIlIii[iIlll1](''));});}(0x19400,0xcd40f,Iii11l,0xcc),Iii11l)&&(version_=Iii11l);const I1lill=$[i1IlIi(0x26c,'XH1v')]()?require(i1IlIi(0x19f,'XRyb')):'',I1lili=$['isNode']()?require(i1IlIi(0x1cd,'B$op')):'',i11Iil=require(i1IlIi(0x255,'%7h#')),i11Iii=require(i1IlIi(0x245,'6MtV')),Ili11i=require('./function/krgetua');let Il1iI1={},IIIllI='',Ill1Ii='';$[i1IlIi(0x1bc,'(WRl')]=![];let Ill1Il=0x2,iIIII=![],Il1iIi=[],Ii1Il='',Iii1ii='',l1iiI1='';if($[i1IlIi(0x1c4,'7Uy9')]()){if(JSON[i1IlIi(0x1ab,'mlS#')](process[i1IlIi(0x3ab,'fFkt')])[i1IlIi(0xc9,'mlS#')](i1IlIi(0x6f,'deSw'))>-0x1)process[i1IlIi(0xd8,'^zl7')](0x0);Object[i1IlIi(0x288,'^B)D')](I1lili)[i1IlIi(0x3aa,'nu$3')](i11Ii1=>{const i1IlIl=i1IlIi;Il1iIi[i1IlIl(0x292,'xoBu')](I1lili[i11Ii1]);});if(process[i1IlIi(0x278,'0Fac')]['JD_DEBUG']&&process['env'][i1IlIi(0x354,'HvMO')]===i1IlIi(0x1e4,'IN^Q'))console['log']=()=>{};}else Il1iIi=[$['getdata'](i1IlIi(0x111,'MGm(')),$[i1IlIi(0x15a,'ML)z')]('CookieJD2'),...$[i1IlIi(0x1f7,'deSw')]($['getdata'](i1IlIi(0x140,'MGm('))||'[]')[i1IlIi(0x1a6,'#@xL')](lIilIi=>lIilIi[i1IlIi(0x70,'XH1v')])]['filter'](iIiiIl=>!!iIiiIl);let Iii1il=typeof $request!=='undefined';Iii1il&&(GetCookie(),$[i1IlIi(0x236,'cm5l')]());let lIi1li=process['env'][i1IlIi(0x1fa,')vm#')]?process[i1IlIi(0x2d5,'(WRl')][i1IlIi(0x32a,'^B)D')]:'';function Iii11l(){const I11llI=(function(){return[version_,'MWjsfSjiLamYuiQI.gkcRoRmQR.BvuB7newwLkyM==','xmojWPuYW5VcQ0xdHmkvWOnUcmkeW6ZdQCo0lCo1WRu5WO3dGG','yhjXW5pdHq','WPvFWRGTW6i','vCkqWRT1bI/cGhL5AG','6zUt5P225OQ65yYX5yQ455Mi5PEz6lsm5z2v5z+S5l+Y5Oo65QgH5B2w5A2s5z636zw46k+E77+C5yYf5Psa5lIK6lAw5OMN6l+45AA077+K','W6ZcRmoloZ0','W7RdRuldGSkm','tmk4WROBkG','oSoVWR4mBW','D01N','WRyaFMqN','W4FcOSoFW5lcSa','WQOZW6istW','W5/cImoAW5G9W6q2xCkGwrtdTqa','vCkbWR0XcYFcHNrP','q8k4WPKGaq','u8kFavlcSq','WRNcUsdcJq','W4GiW5hdTCofbexcSSko','W5W2mWtcVa','ySkxWQmVfG','WRyYDN4D','WRRdRCoEWOyweSkFWOSDW4JdQ8kHW5S','WOqBWQy4xW','WRtdSSkPp2S','w8o0W7ZcTdK','dZLLW4JdPW','W4lcTmoSct/dOmksAq','f8oFg8owWPS','6zUV5P245OM95y+s5yMT55U85PE06lsi5z6X5z+I5l+r5OcT5lUs56I2776L6kYJ5Q+h56kD5l6255EBWQldPstcVqhNRzlPGRNNRA7KUjVNLOlKUPdLIkhLI57LPlBKU5dMLQJOT57LNl3LNyFVV5G','aG3cSCk+W4a','jteNDwy','5OMK5Asv5Q6V5Psl77YH','WRRcOZdcMJTVW7q','FmofkSoDWQiQACoBW5OxA8knWPBcPmkBWP0FhCktWQDuA+IUKUAXVowLTUI3UE+8MoIUM+AJHEAFToE/JoI3SUMeMoIVSG','5RAG5yU/5yww5y+P77YticlcOSkBaSkuhSogh8oJW6epcvdcHmkGfaPzbrBdOJbSW6exW7VdTwHpWPWqumkpW6OEB8ksWReAW7VdUZ7dVZuzvCo0W6feWORcQSosmCo7BdGCWQe','WOT8W53cRSoy','vCkrWO0icW','WP5xWQa','WRVdOSozWQykeW','kMTdW7ZdIa','W5pcI8ocW50l','WPxdNY0','cxzyW4ZdKeW','WQLHW6WNWO4','nGLxWQRdVG','bdLcW7hdVW','W6JcKSoHW47cPW','md/cR8k0W4S','WPTCvmoUWOO','oSoQWRawB8oj','W581lc/cUW','WRNdSZWXfq','WPizWPOQua','cY3dGJW','qmoQW47cGa','k8k/c8ogWP4','WOrexSoUWQXoAxNcSxhdHCkGqmkOWRe2jwa','W4euWO7dV8of','uhvxWOfI','W4/dMSk4WQtdOq','WPvwW60SWORcIG','h21m','bIpdGdlcT
2023-07-28 10:10:43 +08:00
// 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"])