From 684a6e902b19a5721b2f9894227afefaaa415786 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Sat, 30 Jan 2021 20:35:35 +0800 Subject: [PATCH] fix --- jd_818.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/jd_818.js b/jd_818.js index 0b3c6a7d..c8fb4c4a 100644 --- a/jd_818.js +++ b/jd_818.js @@ -120,21 +120,25 @@ async function main() { await showMsg() } async function JD818() { - await getHelp(); - await listGoods();//逛新品 - await shopInfo();//逛店铺 - await listMeeting();//逛会场 - await $.wait(10000); - //再次运行一次,避免出现遗漏的问题 - await listGoods();//逛新品 - await shopInfo();//逛店铺 - await listMeeting();//逛会场 - await doHelp(); - await myRank();//领取往期排名奖励 - await getListJbean(); - await getListRank(); - await getListIntegral(); - await showMsg() + try { + await getHelp(); + await listGoods();//逛新品 + await shopInfo();//逛店铺 + await listMeeting();//逛会场 + await $.wait(10000); + //再次运行一次,避免出现遗漏的问题 + await listGoods();//逛新品 + await shopInfo();//逛店铺 + await listMeeting();//逛会场 + await doHelp(); + await myRank();//领取往期排名奖励 + await getListJbean(); + await getListRank(); + await getListIntegral(); + await showMsg() + } catch (e) { + $.logErr(e) + } } function listMeeting() { const options = { @@ -590,7 +594,7 @@ async function doHelp() { //当天大于9:00才从API里面取收集的助力码 //if (nowTime > new Date(nowTime).setHours(9, 0, 0, 0)) body = await printAPI();//访问收集的互助码 body = await printAPI();//访问收集的互助码 - if (body) { + if (body && body['data']) { // console.log(`printAPI返回助力码数量:${body.replace(/"/g, '').split(',').length}`) // tempCode = tempCode.concat(body.replace(/"/g, '').split(',')) tempCode = [...tempCode, ...body['data']]