This commit is contained in:
lxk0301
2021-02-01 10:43:34 +08:00
parent bb6ddca934
commit 5e6e24b176
3 changed files with 26 additions and 18 deletions

View File

@@ -88,7 +88,7 @@ let helpCode = []
// await main(); // await main();
} }
} }
// console.log($.temp) // console.log(JSON.stringify($.temp))
})() })()
.catch((e) => { .catch((e) => {
$.log('', `${$.name}, 失败! 原因: ${e}!`, '') $.log('', `${$.name}, 失败! 原因: ${e}!`, '')

View File

@@ -81,13 +81,17 @@ const JD_API_HOST = `https://api.m.jd.com/api?appid=jdsupermarket`;
coinToBeans = process.env.MARKET_COIN_TO_BEANS; coinToBeans = process.env.MARKET_COIN_TO_BEANS;
} }
} }
if (`${coinToBeans}` !== '0') { try {
await smtgHome();//查询蓝币数量,是否满足兑换的条件 if (`${coinToBeans}` !== '0') {
await PrizeIndex(); await smtgHome();//查询蓝币数量,是否满足兑换的条件
} else { await PrizeIndex();
console.log('查询到您设置的是不兑换京豆选项现在为您跳过兑换京豆。如需兑换请去BoxJs设置或者修改脚本coinToBeans\n') } else {
console.log('查询到您设置的是不兑换京豆选项现在为您跳过兑换京豆。如需兑换请去BoxJs设置或者修改脚本coinToBeans\n')
}
await msgShow();
} catch (e) {
$.logErr(e)
} }
await msgShow();
} }
} }
})() })()

View File

@@ -80,18 +80,22 @@ let userInfo = null, taskInfo = [], message = '', subTitle = '', fruitTotal = 0;
$.done(); $.done();
}) })
async function jd_moneyTree() { async function jd_moneyTree() {
const userRes = await user_info(); try {
if (!userRes || !userRes.realName) return const userRes = await user_info();
await signEveryDay(); if (!userRes || !userRes.realName) return
await dayWork(); await signEveryDay();
await harvest(); await dayWork();
await sell(); await harvest();
await myWealth(); await sell();
await stealFriendFruit() await myWealth();
await stealFriendFruit()
$.log(`\n${message}\n`); $.log(`\n${message}\n`);
if (!jdNotify || jdNotify === 'false') { if (!jdNotify || jdNotify === 'false') {
$.msg($.name, subTitle, message); $.msg($.name, subTitle, message);
}
} catch (e) {
$.logErr(e)
} }
} }
function user_info() { function user_info() {