From aeca907bdd04a4c7839ee798c0d51fd63b45be96 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Mon, 1 Feb 2021 10:43:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_818.js | 2 +- jd_blueCoin.js | 16 ++++++++++------ jd_moneyTree.js | 26 +++++++++++++++----------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/jd_818.js b/jd_818.js index 67c4573d..8cc3ba59 100644 --- a/jd_818.js +++ b/jd_818.js @@ -88,7 +88,7 @@ let helpCode = [] // await main(); } } - // console.log($.temp) + // console.log(JSON.stringify($.temp)) })() .catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') diff --git a/jd_blueCoin.js b/jd_blueCoin.js index d5f7f905..046626c3 100644 --- a/jd_blueCoin.js +++ b/jd_blueCoin.js @@ -81,13 +81,17 @@ const JD_API_HOST = `https://api.m.jd.com/api?appid=jdsupermarket`; coinToBeans = process.env.MARKET_COIN_TO_BEANS; } } - if (`${coinToBeans}` !== '0') { - await smtgHome();//查询蓝币数量,是否满足兑换的条件 - await PrizeIndex(); - } else { - console.log('查询到您设置的是不兑换京豆选项,现在为您跳过兑换京豆。如需兑换,请去BoxJs设置或者修改脚本coinToBeans\n') + try { + if (`${coinToBeans}` !== '0') { + await smtgHome();//查询蓝币数量,是否满足兑换的条件 + await PrizeIndex(); + } else { + console.log('查询到您设置的是不兑换京豆选项,现在为您跳过兑换京豆。如需兑换,请去BoxJs设置或者修改脚本coinToBeans\n') + } + await msgShow(); + } catch (e) { + $.logErr(e) } - await msgShow(); } } })() diff --git a/jd_moneyTree.js b/jd_moneyTree.js index b24906e3..9f35847c 100644 --- a/jd_moneyTree.js +++ b/jd_moneyTree.js @@ -80,18 +80,22 @@ let userInfo = null, taskInfo = [], message = '', subTitle = '', fruitTotal = 0; $.done(); }) async function jd_moneyTree() { - const userRes = await user_info(); - if (!userRes || !userRes.realName) return - await signEveryDay(); - await dayWork(); - await harvest(); - await sell(); - await myWealth(); - await stealFriendFruit() + try { + const userRes = await user_info(); + if (!userRes || !userRes.realName) return + await signEveryDay(); + await dayWork(); + await harvest(); + await sell(); + await myWealth(); + await stealFriendFruit() - $.log(`\n${message}\n`); - if (!jdNotify || jdNotify === 'false') { - $.msg($.name, subTitle, message); + $.log(`\n${message}\n`); + if (!jdNotify || jdNotify === 'false') { + $.msg($.name, subTitle, message); + } + } catch (e) { + $.logErr(e) } } function user_info() {