faker3/jd_jinggeng_showCart.js

23 lines
58 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称加购有礼 · 京耕
活动链接https://jinggeng-isv.isvjcloud.com/ql/front/showCart?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_showCart_activityUrl // 活动链接
jd_jinggeng_showCart_opencard // 是否入会true/false默认不入会
jd_jinggeng_showCart_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 il='jsjiami.com.v7';const ilIIll1I=i1IlII1i;(function(Iil1lll1,IliiilIi,iilIi1il,iIi1I1li,i1ilIlII,lilllIIi,iiiI1li){return Iil1lll1=Iil1lll1>>0x9,lilllIIi='hs',iiiI1li='hs',function(IIi1lIi,IIlII1lI,lilI1i1i,I1lI1il,Iii1I1l1){const illllI1l=i1IlII1i;I1lI1il='tfi',lilllIIi=I1lI1il+lilllIIi,Iii1I1l1='up',iiiI1li+=Iii1I1l1,lilllIIi=lilI1i1i(lilllIIi),iiiI1li=lilI1i1i(iiiI1li),lilI1i1i=0x0;const lI1ilIl=IIi1lIi();while(!![]&&--iIi1I1li+IIlII1lI){try{I1lI1il=-parseInt(illllI1l(0x29d,'b$zG'))/0x1+parseInt(illllI1l(0x24d,'PEh7'))/0x2*(parseInt(illllI1l(0x23c,'u2#%'))/0x3)+parseInt(illllI1l(0x26f,'x]xz'))/0x4*(-parseInt(illllI1l(0x3ad,'IFT)'))/0x5)+parseInt(illllI1l(0x2be,'x]xz'))/0x6*(-parseInt(illllI1l(0x2fe,'i&sO'))/0x7)+parseInt(illllI1l(0xb0,'i&sO'))/0x8*(parseInt(illllI1l(0x13a,'b$zG'))/0x9)+-parseInt(illllI1l(0x221,'lh8J'))/0xa+parseInt(illllI1l(0x18a,'amt2'))/0xb;}catch(Ill1lii1){I1lI1il=lilI1i1i;}finally{Iii1I1l1=lI1ilIl[lilllIIi]();if(Iil1lll1<=iIi1I1li)lilI1i1i?i1ilIlII?I1lI1il=Iii1I1l1:i1ilIlII=Iii1I1l1:lilI1i1i=Iii1I1l1;else{if(lilI1i1i==i1ilIlII['replace'](/[uDqXwHNTGeEVLKlbP=]/g,'')){if(I1lI1il===IIlII1lI){lI1ilIl['un'+lilllIIi](Iii1I1l1);break;}lI1ilIl[iiiI1li](Iii1I1l1);}}}}}(iilIi1il,IliiilIi,function(ll11lllI,ll11IiiI,l1ll1I1l,l1liilIl,IiIiIiI1,lllIIiii,Illliill){return ll11IiiI='\x73\x70\x6c\x69\x74',ll11lllI=arguments[0x0],ll11lllI=ll11lllI[ll11IiiI](''),l1ll1I1l=`\x72\x65\x76\x65\x72\x73\x65`,ll11lllI=ll11lllI[l1ll1I1l]('\x76'),l1liilIl=`\x6a\x6f\x69\x6e`,(0x16f5d8,ll11lllI[l1liilIl](''));});}(0x18400,0x9f020,IlilIIlI,0xc4),IlilIIlI)&&(il=`\x843`);function IlilIIlI(){const iliii11i=(function(){return[...[il,'ujsNjeibLawHmiqlE.GcDEoVmKV.bvlHT7PPVDXq==','cMJcN8kcudpcVG','B0nIASoTW4nkASkSw8oe','lCo0aCoeW7W','5P2R6iki6i6L5y+m55sI5OIB6yQp5P+75lYG5Ooc77+8','W7dNUyRMNjdVVQVKUkRMRklMLkBNGzdMN4xLKk/cIG','hmkpzCo9W6PwF8oFWPZdLSo1WOldV8kX','W49sW5K','WOhdJ1GRWOOuWOW','bCkiWPtdMSovW5eTn3/cGa','W5FcHWKZ','4P2VW5VMN5hOGzlMR4tNO5ZLPyZNKiXV','WOVMT4BLIPxLTRpKUB9K','W4xdVapcQGJdRG','g8oLkhRcGq','W55YW7VcJCoEm2NdNmkyWRezWR8a','W7FcMfmLWPq2oaO','dIrZW7Px','dmoKna','W4JcQL8XWRC','W4/cNqKVrZO8ba','WQldRchdOK9N','WP/dN0G7','5yIs5yEW5BU66zc05l295zob5AEr6lAT77+05RAV5yUs5lQh6zQf5BQe6zcW5l2j5zg/5y2U5lIv5zgwva','W7ldSCkY','vdtcNCoXka','EmoYWPJdSCk+WOS','vow7PoMsOEMsP+AnUo++S2XTWPrXW4CbW6ZdJmkHW5FdHYxcQqffWRG1W5e/B8kLWOuIzCkJtCoFWOSkWR1nW6i','zEA0VEwjK+IKKUwiOo+9HowjU+I3Qa','w8oEtW','W4LBWOBcQSks','W5b1imkWW7C','jbTK','W4NcK3WxWOy','BVcQGka','5zwQ5AY1WPWAW7ldHSkV6l+85P69','C2GTcr3cRSoA','WPNdUH5tWOdcRCkKW50lvXjnW55rkmkoWR0','fSkpySolW6DuDW','gWn7s0q','rCoTWOWqW6e','W4hcIJTequ/cVCkufa','y0f4DSkrWP4','5lMB5AA96yko556W','W4vjW5/cPCoy','ESo3mNJcQ8oRW4FdU3/dPmoECNWnW4tdPmob','cNlcUmktAq','csdcU8oHgW','W4hdSbNcJqJdTSklW6hcNq','mXiR','j8oKlLlcQ8o7','m1JcSSoDC8kSW7WtW7/dKsXoWQC','BUA1TowkREEXGowDOE+8Ja','pYKcWORdSrXv','icKfWOVdQq','WRJdVc7dG0rXWRW','W5pdSqNcObldTa','W4VcNr0','5BAB5yMR6lsG','jXXQ','W4tdTahcUWi','WQ3cVLawWRFdJSoC','bCoLn8ouWOjiWPq','v8o+bhZdKftcPSoxW5rsW7y','c8klzCoqW6HsF8oF','wSoFwJfRW6iTjG','5lU65AYe6lwsWQ3NU7lMNzZMLlNPLj3VVRO','xSo2WOyWW7FdHW','tKGyWOfMB0dcVhi','pMxcPSouCG','tSoSWOWm','iKFcSComxmkSW5S/W7ddLZ0','bmo5mSo3WQPsWPdcOWDjW4CS','W4XFWOhcQW','W6NcKK41WP8LhaS','W43cKhiWWR4','776R5Bsa5OMQ5yUe6iEd5yUZ55IQ6k+r5PA66lEA5z6C5zYikei','if3cRmo9C8kS','W4BcHcPfC0BcUSkt','ESkK5lUa6z2P6ksV5yEL5yMo6lAx','W5b3W7/cRSoCnK0','umoFtG','wSo8pCk5WPGkv2tcJSoqd8oK','cCoLn8oLWPm','8lEgKU+5LX3KV6/MG5lLIzq','W7v7l8kYW4vDlhDOWOS6W5BcVw3cKq','W4TkWONcO8km','W79TjG','ccbI','gSkaW5CsDa','lZBcQCoWaG','8jATRU+5Mmom','xMvdxCk5','WOK0CCkUhCordmoj','W6f1kmkqW7zgjG','rSkyBqddOW84WO3dH8o0WOxdQSoqW50IEayHWPmdygj9ka40WRddGeTQBrFdO8kIW450','W4LBWONcVSoszmkLW5qswW','cmk8Bmo6W4HSCg3cRSo7nmo4','tmo8WRFdT8kE','jbT2gSktWOv+CCoBCmkjc8oTW5RdVSoAW4z4W5i/umkJBmopCJJdPmopCYJcTX7cI8oat8oytmkXWRbvodruxdddL8k+','zSohWRCXW4BdOmkoBSoYdgm','amo3ketcGG','WQVLU5tPKQlPK4pMJzlVVkGeaSkzWP7cQCo5WRBcPZldNmkpl8oTW5VdMN0fA8kboCoWW5KgqmoJjSkzoLjAymoW','W4VcIxeIWOq','DSoUWP0gagm','W6JcScKoBW','dwtcUCkHqW','rfFdPSoIW4/cHcuPWR7dTmoYWRxdRhe0','4PUxWORORQNLHBZLRyZKUBdLV4R
// 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"])