mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
24 lines
128 KiB
JavaScript
24 lines
128 KiB
JavaScript
|
/*
|
|||
|
活动名称:完善信息有礼 · 超级会员
|
|||
|
活动链接:https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=<活动id>&venderId=<店铺id>
|
|||
|
环境变量:jd_completeInfoActivity_activityUrl // 活动链接
|
|||
|
jd_completeInfoActivity_joinMember // 是否开卡,默认不开卡
|
|||
|
jd_completeInfoActivity_notify // 是否推送通知,默认不推送
|
|||
|
|
|||
|
7 7 7 7 * jd_completeInfoActivity.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('完善信息有礼(超级会员)')
|
|||
|
const jdCookie = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
const { wuxian_savePrize } = require('./function/savePrize')
|
|||
|
const CryptoJS = require('crypto-js')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const lilIII=l1IIlll;(function(IiIiii1I,I11Ill1i,iIIiI11i,I11Illi,lIlI11ll,i1il1i11,liliilI){return IiIiii1I=IiIiii1I>>0x1,i1il1i11='hs',liliilI='hs',function(llII1i,IIl1ilii,iilI,iI1iiIIl,Il11i1){const IIi1iiII=l1IIlll;iI1iiIIl='tfi',i1il1i11=iI1iiIIl+i1il1i11,Il11i1='up',liliilI+=Il11i1,i1il1i11=iilI(i1il1i11),liliilI=iilI(liliilI),iilI=0x0;const i1il1Iil=llII1i();while(!![]&&--I11Illi+IIl1ilii){try{iI1iiIIl=-parseInt(IIi1iiII(0xc0,'@5mO'))/0x1+-parseInt(IIi1iiII(0x1d4,'jh4f'))/0x2+parseInt(IIi1iiII(0x561,'GhdW'))/0x3+-parseInt(IIi1iiII(0x407,'ytq!'))/0x4+parseInt(IIi1iiII(0x687,'ofIG'))/0x5*(-parseInt(IIi1iiII(0x1f7,'76&a'))/0x6)+parseInt(IIi1iiII(0x309,'Y7)]'))/0x7*(-parseInt(IIi1iiII(0x4d3,'VtO9'))/0x8)+parseInt(IIi1iiII(0x56a,'Io^X'))/0x9;}catch(III1iI1i){iI1iiIIl=iilI;}finally{Il11i1=i1il1Iil[i1il1i11]();if(IiIiii1I<=I11Illi)iilI?lIlI11ll?iI1iiIIl=Il11i1:lIlI11ll=Il11i1:iilI=Il11i1;else{if(iilI==lIlI11ll['replace'](/[KLWdbJwMAUCTyGhVQnD=]/g,'')){if(iI1iiIIl===IIl1ilii){i1il1Iil['un'+i1il1i11](Il11i1);break;}i1il1Iil[liliilI](Il11i1);}}}}}(iIIiI11i,I11Ill1i,function(l11ill11,I11II1Il,lIilll11,i1iiIilI,l11lIlli,i1i1IlIl,iiI1I1lI){return I11II1Il='\x73\x70\x6c\x69\x74',l11ill11=arguments[0x0],l11ill11=l11ill11[I11II1Il](''),lIilll11=`\x72\x65\x76\x65\x72\x73\x65`,l11ill11=l11ill11[lIilll11]('\x76'),i1iiIilI=`\x6a\x6f\x69\x6e`,(0x152dca,l11ill11[i1iiIilI](''));});}(0x198,0x363b9,ililIlI1,0xce),ililIlI1)&&(iil=0x7fe);const activityUrl=process[lilIII(0x1b6,'YblA')][lilIII(0x3e6,'zf9z')]||'',joinMember=process[lilIII(0x5e7,'5Lv%')][lilIII(0x204,'76&a')]===lilIII(0x119,'jnvS'),isNotify=process[lilIII(0x1de,'zf9z')][lilIII(0x1cc,'ob^Z')]===lilIII(0x540,'YblA');let cookie='',activityCookie='',originCookie='';const cookiesArr=Object[lilIII(0x448,'[7bp')](jdCookie)[lilIII(0x38d,'*^fe')](IliIlIi=>jdCookie[IliIlIi])[lilIII(0xc7,'Vpk&')](li1I1Ill=>li1I1Ill);!cookiesArr[0x0]&&($[lilIII(0x2ec,'jnvS')]($[lilIII(0xc6,'@5mO')],lilIII(0x510,'$7x)')),process[lilIII(0x2f8,'*ooX')](0x1));function ililIlI1(){const l1lilIIi=(function(){return[...[iil,'KMVjJsDjWniQamCAi.nQcUoDdmby.LWvnT7AhGyw==','WR7cNmoAW6tdN3lcN33cNqtdJ0hdTq','khXzWOxcQ8oPW5SUWRZdMmoOjrlcGaFcTmkgW4ZdKmoyeCoHW4LHW5uJwGyjfvyUfJVdM8orpSohBhfFWPikd0XScCkuW7H4mwhcU8krW7FdVSkthLZdTCkFqSk5WO/cR8owdGOsfCo9W4lcV25/nXincmkYtLPWdvRcHN/cQtOuW5NdMmohW5e8AmkGAHmKWODWBhCEtbOvwColiWPWnSoTWQSVExBcPXxcNCoooCoigcZcGCkxWOqwt8o4AMGOeCkusCkhaCoCW5rbWQxcRSkKWRK2jWddM37cLCogbmkKW4jWW6jCyv/dPtZcUtRdTmo+zmkvngJcV8kvqs4fp1LmW67cJmkJW6pdNqzNW5rdlw0OF8oXW6XDW7G0WR8','WReIoMuX','W7TyW57cS2m','W5FdR8o8W4BdSW','t3pdQqldVW','WPJcKSonWOq2','WRlcLhT9WPG','WO7cH3rkWQu','WRviW5G0oHlcKCoT','W65iW57cO0ZcKq','WQHtWRFcNSoa','W7JdKCowlx4','5BQf5zcK566Y5yIF','kCoRD8oRbG','rx3dPSkema','dCkarCkvF0fRWQ3dI8k0WQJcMCovW5mJW78','WOxcKMCEWOe','W73ORj7MS6VLPQhOTPxVVjFcJNFcGaddHuhdSSoFWQVcNgldVYOG','ggVdLG','vZFcTSoKqImCWR/cTa','W5DsW6NcJe4','WONdTSofwZnLWOBcImoA','WOVcU8ogW5ZdKG','WRDJWQusDa','W6/dHuCrWQJdNG','WRxcNmoFW53dOG','W4rAW5NcJW','5OMi6lAu6AgS6zEY','WR5UW5upaa','v3pdPIhdJG','xGdcVSkPWRq','WRhcMCokW7NdNW','5P6E5zI05lQY5Bw/56Ua5BQ2','WQFcIqpdSJy','WOlcHsFdLSo4','WPlcN1C5','aLRdJq','W5tdUmojleKaW4BdPHe','WR/dMmoJqd4','W43dQmotdKatW6G','W4zhgSkeW5y','5Aw45yEM5yYg','WQjFW5uMcHlcVmoKW69+','WRNcSSoYWRO6WROf','rvtdPHrbWRTvyw4','W6TtkY/cIq','WP3cKmoUWRW1','6i6d5y6LWPhcSCkckqSMFSoraNxLPP/OTlu','WQSPmgqhW7/dKSkPW6yf','5ygj6lIH5PwS57Qr','W4tXG7+K77Qh','rWrcwrLR','W6RcM8kKv8oijSoyWQ9Rca','DtJcVCkuWRm','W5r2bd/cRW','c8kvqCk0B3jJWRFdHq','WRJcKCorW6hdGa','W59zmZBcRa','hLtdMmoTW50','6ysf6j2A5yQh5P2z5BMt','qqjfwcr9WO8qWRm','W69rW5NcHuC','ECoKCshdLq','DZnWzde','CtzkuHS','WP7dR8ogW4BdPWrybW','bpcEORe','rCoLzYddHa','vmkcxGDbW43cSCo3W40','WRDsW50QjW','heddHmoBW5ym','pSoXsmobkweaWO3dISkmWQuo','lxaEz8kRW5FcVSod','jKRdNxBdGCoUkd0L','WOtcSN/cS8oP','qrNcQCktWPq','W4xdNXRdO0a','uMBdRZ/dKa','W4vvW7/cHWa','WPBdRCoq','gSkvw8kDC1bdWR0','8lYvQ++7LbhKVzBMGANLIAi','WPFdISoyW7/dUq','rSoLudZdQq','WOblWQ4uv8kvWPq','6yA56zYz5RYf5zke','W63cRSk2tmoh','WQ0nWP1EWRy','fmoxtCobfq','W7LEW6ZcVZS','WOGKg2eF','W47dQSovW43dIW','WO7
|
|||
|
|
|||
|
// 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"])
|