This commit is contained in:
Faker 2022-07-19 17:37:39 +08:00
parent 12768ee97a
commit bd09b175a6
3 changed files with 357 additions and 43 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/**
特务之明星送好礼
一次性脚本请禁用
cron 36 2,19 * * * jd_superBrandStar.js
第一个CK黑号自动退出
15 5,21 * * * jd_superBrandStar.js
*/
const $ = new Env('特务之明星送好礼');
const notify = $.isNode() ? require('./sendNotify') : '';
@ -30,7 +30,7 @@ if ($.isNode()) {
$.isLogin = true;
$.nickName = '';
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
//await TotalBean();
await TotalBean();
console.log(`\n*****开始【京东账号${$.index}${$.nickName || $.UserName}*****\n`);
if (!$.isLogin) {
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
@ -41,7 +41,7 @@ if ($.isNode()) {
continue
}
await main();
//if (i == 0 && $.flag) return;
if (i == 0 && $.flag) return;
}
})().catch((e) => { $.log('', `${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })
@ -50,7 +50,7 @@ async function main() {
$.runFlag = false;
$.activityInfo = {};
await takeRequest('showStarGiftInfo');
if (JSON.stringify($.activityInfo) === '{}') {
if($.bizCode == 'MP001'){
console.log(`本期活动结束,等待下期。。。`);
$.flag = true
return;
@ -161,6 +161,7 @@ function dealReturn(type, data) {
}
switch (type) {
case 'showStarGiftInfo':
$.bizCode = data.data.bizCode;
if (data.code === '0' && data.data && data.data.result) {
$.activityInfo = data.data.result;
}

289
jd_twjk.js Normal file

File diff suppressed because one or more lines are too long