mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
23 lines
56 KiB
JavaScript
23 lines
56 KiB
JavaScript
|
/*
|
|||
|
活动名称:盖楼有礼 · 京耕
|
|||
|
活动链接:https://jinggeng-isv.isvjcloud.com/ql/front/floor?id=<活动id>&user_id=<店铺id>
|
|||
|
环境变量:jd_jinggeng_floor_activityUrl // 活动链接
|
|||
|
jd_jinggeng_floor_opencard // 是否入会(true/false),默认不入会
|
|||
|
jd_jinggeng_floor_Notify // 是否通知(true/false),默认不通知
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('盖楼有礼(京耕)')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
const { jinggeng_savePrize } = require('./function/savePrize')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const I1i1I1i=IlIlI1i;(function(liil1I,iiililI,lIIliI,iii1Ili1,IiI1IiiI,l1lliIIi,IIl1iIli){return liil1I=liil1I>>0x2,l1lliIIi='hs',IIl1iIli='hs',function(il1ilIlI,il1iI1II,I1IIi1i1,llllIIl,IIi11iI){const illI1Il1=IlIlI1i;llllIIl='tfi',l1lliIIi=llllIIl+l1lliIIi,IIi11iI='up',IIl1iIli+=IIi11iI,l1lliIIi=I1IIi1i1(l1lliIIi),IIl1iIli=I1IIi1i1(IIl1iIli),I1IIi1i1=0x0;const l11IiII=il1ilIlI();while(!![]&&--iii1Ili1+il1iI1II){try{llllIIl=-parseInt(illI1Il1(0x161,'hsQ9'))/0x1*(-parseInt(illI1Il1(0x303,'XQYS'))/0x2)+-parseInt(illI1Il1(0x370,'hsQ9'))/0x3+-parseInt(illI1Il1(0x2c0,'8g]2'))/0x4*(parseInt(illI1Il1(0x2dd,'7VfC'))/0x5)+-parseInt(illI1Il1(0x258,'eNR5'))/0x6*(-parseInt(illI1Il1(0x1c5,'eNR5'))/0x7)+-parseInt(illI1Il1(0x37d,'ZBdz'))/0x8*(-parseInt(illI1Il1(0x25d,'NyO4'))/0x9)+parseInt(illI1Il1(0x433,'w%[%'))/0xa+parseInt(illI1Il1(0x22d,'*77%'))/0xb;}catch(lIi1IlII){llllIIl=I1IIi1i1;}finally{IIi11iI=l11IiII[l1lliIIi]();if(liil1I<=iii1Ili1)I1IIi1i1?IiI1IiiI?llllIIl=IIi11iI:IiI1IiiI=IIi11iI:I1IIi1i1=IIi11iI;else{if(I1IIi1i1==IiI1IiiI['replace'](/[SWEVBMfhbtNOHUplLdr=]/g,'')){if(llllIIl===il1iI1II){l11IiII['un'+l1lliIIi](IIi11iI);break;}l11IiII[IIl1iIli](IIi11iI);}}}}}(lIIliI,iiililI,function(I11Il,i1ilII1,i1Il11ll,lIlil1iI,IiilIIiI,Ii1l1l1l,iilll11){return i1ilII1='\x73\x70\x6c\x69\x74',I11Il=arguments[0x0],I11Il=I11Il[i1ilII1](''),i1Il11ll=`\x72\x65\x76\x65\x72\x73\x65`,I11Il=I11Il[i1Il11ll]('\x76'),lIlil1iI=`\x6a\x6f\x69\x6e`,(0x16f5d5,I11Il[lIlil1iI](''));});}(0x318,0x41c0b,iiI11Ii1,0xc8),iiI11Ii1)&&(iil=0x1e05);const activityUrl=process[I1i1I1i(0x308,'8QdV')][I1i1I1i(0x437,'8QdV')]||'',joinMember=process[I1i1I1i(0x327,'XQYS')][I1i1I1i(0x3a7,'GR6c')]===I1i1I1i(0x443,'9L[c'),isNotify=process[I1i1I1i(0x417,'ZSC1')][I1i1I1i(0x25e,'hsQ9')]===I1i1I1i(0x163,'kqI*');let sid=common[I1i1I1i(0x353,'2Z)n')](0x20,I1i1I1i(0x2ab,'9L[c')),un_area=common[I1i1I1i(0x226,'9H8V')](0x1,I1i1I1i(0x187,'ixo4'))+'-'+common[I1i1I1i(0x250,'8g]2')](0x4,I1i1I1i(0x376,'D50g'))+'-'+common[I1i1I1i(0x316,'kKVo')](0x4,I1i1I1i(0x1c8,'!O!4'))+'-'+common[I1i1I1i(0x2b4,'Fn4r')](0x5,I1i1I1i(0x366,'8g]2')),default_drawnum=0x2,comments_arr=[];const prize_type={'JD_BEAN':I1i1I1i(0x3ec,'Ud#G'),'JD_POINT':I1i1I1i(0x299,'jqIA'),'JD_GOODS':I1i1I1i(0x195,'f#x$'),'JD_COUPON':I1i1I1i(0x2d3,'f#x$'),'JD_J_COUPON':I1i1I1i(0x2eb,'8QdV'),'JD_D_COUPON':I1i1I1i(0x439,'D50g'),'JD_AIQIYI':I1i1I1i(0x416,'kKVo'),'JD_PLUS':I1i1I1i(0x233,'fSOm'),'JD_E_CARD':I1i1I1i(0x32b,'JVXh'),'JD_REDBAG':I1i1I1i(0x1d6,'$E87'),'-1':I1i1I1i(0x1d7,'kKVo')};let JSDOM=null,cookie='',activityCookie='',originCookie='';const cookiesArr=Object[I1i1I1i(0x222,'!O!4')](jdCookie)[I1i1I1i(0x225,'UI%Q')](iillII11=>jdCookie[iillII11])[I1i1I1i(0x35c,'qHzv')](l11l1li=>l11l1li);!cookiesArr[0x0]&&($[I1i1I1i(0x18d,'f#x$')]($[I1i1I1i(0x3b6,')Smi')],I1i1I1i(0x429,'kqI*')),process[I1i1I1i(0x2a3,'8g]2')](0x1));!(async()=>{const lIi1I1il=I1i1I1i,Il1iIlli={'JBHal':lIi1I1il(0x276,'NyO4'),'xpzfT':function(lI1Iili,ll11il1l){return lI1Iili!==ll11il1l;},'CwLmj':lIi1I1il(0x393,'P%bL'),'HwHmA':lIi1I1il(0x297,'2Z)n'),'idehE':lIi1I1il(0x3e0,'74ja'),'nnhDX':lIi1I1il(0x339,'st5^'),'CqqZU':lIi1I1il(0x249,'JVXh'),'fCACH':lIi1I1il(0x25a,'hsQ9'),'dCmZF':function(l1ii1lil,li1Ii1I){return l1ii1lil+li1Ii1I;},'YHvcO':lIi1I1il(0x14f,'qHzv'),'BqCzW':function(iliIllil,Ii1l1Ii){return iliIllil<Ii1l1Ii;},'YQUNn':function(il1il1II,l1i1II1){return il1il1II===l1i1II1;},'NdJBW':lIi1I1il(0x427,'8QdV'),'hrXPN':lIi1I1il(0x3af,'!O!4'),'VTeRf':function(i1iii1I,iliIiIl){return i1iii1I(iliIiIl);},'dFyxm':lIi1I1il(0x2cd,'7VfC'),'JiZxW':lIi1I1il(0x30a,'4WTx'),'jyTPc':function(Iil1IIll,iliI1l){return Iil1IIll*iliI1l;},'ORuGm':function(lI1li1I){return lI1li1I();}};if(!activityUrl){if(Il1iIlli[lIi1I1il(0x213,'[^2b')](Il1iIlli[lIi1I1il(0x2c7,'kqI*')],Il1iIlli[lIi1I1il(0x2a5,'qHzv')])){console[lIi1I1il(0x2d2,'P%bL')](Il1iIlli[lIi1I1il(0x28b,'4WTx')]);return;}else I1I1il11[lIi1I1il(0x24b,'LsMn')]=!![];}const l1l1Ili1=common[lIi1I1il(0x234,'fSOm')](activityUrl);if(!l1l1Ili1){console[lIi1I1il(0x330,'qHzv')](Il1iIlli[lIi1I1il(0x191,'eNR5')]);re
|
|||
|
|
|||
|
// 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"])
|