faker3/jd_jinggeng_showDrawOne.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/showDrawOne?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_showDrawOne_activityUrl // 活动链接
jd_jinggeng_showDrawOne_opencard // 是否入会true/false默认不入会
jd_jinggeng_showDrawOne_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 li1i1lil=lIliI111;function Iilil11i(){const Illll11=(function(){return[...[il,'dPjLHsHHjiSuaBWmfAJiK.OQcDdoutgm.vqd7uOS==','W73dU0hcG8k8','Fxf1oxa','uYhdHSo+','a+ocQow6LEMrMEwsKEEKSoodQ18','FSkLWO0TWQ/cQ8o6A8oFB1ZdT3pdMW','8kY8Smox5OcY5zsb6i6h5B+7','W73dNGH+WRy','W43JGQRMTz3LIBdLNOlLNyFJGQi','5Rs55yIb5BA057I25P6y','bmo+WQVcKmo/W5C','WOJdKd/cTCoJ','WOBdOrddRrC','W6vmDGHyW5/cIu3cRWxdJ8oiW7asWQZdHCogW4VcRmoVea','W4nwlCk4jNC3vHZcSv0oACozxrDxW6VdHMONwGFcHaCqeSkjWQhcR0PkWQ4','vmoYw8kkW63cSSk3WR9AW7i3BKtdGG','omoprGbK','wSkVWPCCWQBcOmoJi8oLyM7dQW','mYxdJKm','ESk+ac/cJeLJ','mSknoWdcKW','aHZdVh7cLmkKWPdcLZaFW61mWPFcVrddQ8oj','AEAlL+s6SowUIEEkKCoL','wSo5qCkQW7pcN8koWPD4','vCorW6jEWRpcTZjAW7PpW4L/o8ox','W6hdNHtcUCofrmoCbLvMjCkxW6OcW43dUZXqg8o/jsO','WQRdVaBdGr9DzeO','dgOCAmkj','uYNdGCoUWRpcOW','W4j5AYL6','mXVdHudcMW','W7hdRWnnWOquW7jn','hCkzgmosW5ucamo3','W4hdJCo/W6FcQ8oNlqldKmkyxmkSghJcMei4W5JcSufC','ASk0WOSbWQ3cQCo+Amoi','57Uk5y6Li/cqTli','W7PGcmoKWOG','E8kdW6ldS3tcGgr3','EmkFeZdcMq','Cb/dT8o7AYyJxSovW6JcSmoK','ECozCmoqW7K','mZ7dTfRcTa','W7TmCG','smkubY3cQq','WRhcNmo5W5RcO1BcOG','q+E6UEAFGU+8M+s7S+AVPoAuM+EbGUACSowrQCoM','vmktWQ4NWPi','W41XW6uz','57Q75y+f8yg2JW','5lUq5Aw76ygq55YQ','BMtdNCkoW4qQWPW','qYxdM8oyWRNcP3HCamkeW5vwWOxdLsZdN8k0','CxtdGmk4W4SP','eZ9qWRFdR8kE','esWWW7vB','WPtcUmoi','W45joG','dHS/W4jexmke','WR3cMSo+W6FcO1ZcOG','W4Dxkmk9o20ttbhcILPmzG','bCkxW4xdTSkg','zCkbW6ldPM4','4PQIWONORRhLOO7LHz7MOytLVitMRRpNOjpNMRlPKP3MJAC','W4FcSSkNF3a','5REN5yIX5BAA57M25PYL77YJ57U+5P2X5PwP6zsn77+b','jbW4W4ba','5RAz5yQo5lQy6zQe5BUy6zoU5l2m5zg65y635lUq','l8ozWRpcLSoI','WP3dIZldQqG','cUE7SUADTEAuQ+MuKU++NW','uUwSPUEjQ8o+','W5tdK8o5W7RcMCoSbWldGmkpxCkKhG','m+IZJEIXKowoT+s7I8oN','ESoDBmohW5lcR8kofCk1WOm','WRSEWQnXWQSEDCoxCCoTEa','FUw/KEwNPo+9VoAyTEEcO+whM+AEPUwqMSkU','emoVCcWJ','a8o3zdrA','b8kaW4BdQSkHcM89WQnGW6GbW6i','WO5fjCk/WOhcGCopgG','nCkowa','gSoKEtO','W5nHW7ujW4/cLui','W73cU8kfFxa','W7dcK8kjq11kcH8','8y68S0BMGRxLLk7OJRdLVktLR63NIzjS','W6NdOW5cWQ8hW5zm','ymoXzmoAW5G','FSkFW7y','W53dJCoR','WRBcNCoEW4BcQvtcQq','WPRcTSoCW5y8WPbq','WR8EWQb6WRGjBmoC','W4tcGSksyh4','BK3cVmkInMPPzmoJW5RcKmooxIuRcg4','WRLfWO0','W43cMKBOS7ROSPdLJ4xKUR0','C0rEWPdcJ8o9W47cKZJcQa','W5FcV8kSz18','W4xdTCoFW7BcOG','k0/cKCkNmxaHCmoJW4dcUSo4vqmThef3qSkiWQBcQ2jRW7fKvvSFlr3cNdfMW4G','s8kuWQWMWOC','kfKbv8k8','lutcQq','cSobCfJcGe3dTa','W7WwW7S2wW','jcmsW6PG','WOiLsSkFW7S','u8orW6W','w8oFW79r','WPqrzCoNEsC8AZ/cSuTp','k0/cKCkNmxaHCmoJW4dcUSo4vqmThef3qSkiWQBcQ2jRW793rfWkjrVcGq','k0i7DSkfW7xcGmo4t8kUW6mmWRW','W4ddHxm','fmkfha','77215Bse5OMR5yI46iws5yUp55Iv6kYZ5PE46lwd5z+05z60FCke','W4tdTSo0W6dcQq','aSosvxxcSa','bpcVKPK','W7VdLSoNW6hcOq','nEA2HEwiO+EXI+wDQ++/Hq','W4pdL8oIW5BcG8oX','W6ddRXLSWO0dW5zmW4qjW5TQW4KC','qxGBWQS+','WQVdUahdKq','WPhcTSoOW5hcSq','b8o4CZThWPOzW4W','W4TCW78DW6y','w8oYtSkRW6tcPCkP','m8kYjmoJW6CKiCowWP4RWOO','W6lcSbOUWPZcRsrYlG','4P+GWORMNl7NNkZORlhMS5pcKa','emkitJRcPuhdJLVdVa8aW5e','yM4iWR8o','xgDli20','uH8WWO5hxCkyW4a/W7nwW6pcQ0LxW6P2W6L0W6imlCkSWQJdGG','56Ue5Rcq8l6ZKG','WRSoWQbBWRmF','WRdcLSoT','oCk3dW','aCk9W6ldT8kl','rmkxpJtcTW','dmoNWRNcH8oPW7FcVvX5','W7WkW78','W7ZcS8k/qey','WRxLVkpLP47VVBdMMytNGjtLHAVMNyBLK7W4','W6tdJSk5WPRdTaNcRmoUp8kmW6JdSq','ofyGE8kuW77cJmoY','W6NcK8kethXC','F8kVWPueWQZcUCoezSoEAW','xSoKsa','xSoDW79zWPBcTILtW6jyW4G','omkmnmkvWQxdUmk2kSkcWPGnWQC','WRDPfCkmWOdcTCoYmmo4','W4tdLSoyW6VcSG','imkmst7cKLRdLa','zCk6dG','WPfclq','pSkcuZ3cOuJdNW','44g+5lI65lIm6lwX5y+f','5BUQ6zku5zgr56wr77Y7da','iSkcjbRcGa','WQ0uWQ1RWRaEs8om','lSooWPyTW7L+dtm7','spgeV7m','WPvcj8kQ','B27dIq','utNdVSoiWRq','W6xdNepcMmkO','pvGNB8kJW7NcQW','ihJcGCkzia','BMddNG','bCkUibVcGq','8yUpLmoNgNdcLSoH5l6n5zgGW53WPkYm','W7/dTCoFW7tcPG','WPBcVCovW7NcJMtcLa','WRlcK8oWW7K2WQfZwhnFFa','W71mDGHWW4ZcI0y','W7FdPr5DWQCuW5rhW54+W7f2W6mtW5tcKZyrWQhdGg4','c8oNzt5gWOC5W5hdUSodW74KW5C','WOFKV6hMGARLIPhcNW','W6bOeSoJWO/dQW','ba/dQvlcLmkGWP/cNJS6W5PuWRdcRq','W7VcI8kFqwDsiHtcSmokW5iIW7C','8jUHHmkX56U95Rco','5REY5yUt5P6V5lUO77+h5Q605QYe5OIf5Awo5Rsl6icB','D0ux','iSkEtdFcQW','wSo5tmkJW7tcS8k/WQK','E8kxWQWBWQW','b8ovD3VcUv7dVW','WQm1WQG6CSkIW5/dSG','WPddSs3c
// 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"])