@ -62,6 +62,8 @@ if ($.isNode()) {
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
$.message = '';
|
||||
$.balance = 0;
|
||||
$.expiredBalance = 0;
|
||||
await TotalBean();
|
||||
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
|
||||
if (!$.isLogin) {
|
||||
@ -73,6 +75,7 @@ if ($.isNode()) {
|
||||
continue
|
||||
}
|
||||
await bean();
|
||||
await redPacket();
|
||||
await showMsg();
|
||||
}
|
||||
}
|
||||
@ -86,9 +89,9 @@ if ($.isNode()) {
|
||||
async function showMsg() {
|
||||
if ($.errorMsg) return
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}`, { url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean` })
|
||||
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}\n当前红包:${$.balance}元🧧\n即将过期红包:${$.expiredBalance}元🧧`, { url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean` })
|
||||
}
|
||||
$.msg($.name, '', `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}`, {"open-url": "https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean"});
|
||||
$.msg($.name, '', `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}\n当前红包:${$.balance}元🧧\n即将过期红包:${$.expiredBalance}元🧧`, {"open-url": "https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean"});
|
||||
}
|
||||
async function bean() {
|
||||
// console.log(`北京时间零点时间戳:${parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000}`);
|
||||
@ -255,6 +258,43 @@ function queryexpirejingdou() {
|
||||
})
|
||||
})
|
||||
}
|
||||
function redPacket() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://wq.jd.com/user/info/QueryUserRedEnvelopes?channel=3&type=1&page=0&pageSize=100&orgFlag=JD_PinGou_New&expiredRedFlag=1&sceneval=2&g_login_type=1&g_ty=ls`,
|
||||
"headers": {
|
||||
'Host': 'wq.jd.com',
|
||||
'Accept': '*/*',
|
||||
'Connection': 'keep-alive',
|
||||
'Accept-Language': 'zh-cn',
|
||||
'Referer': 'https://wqs.jd.com/my/redpacket.shtml',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
"Cookie": cookie,
|
||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0")
|
||||
}
|
||||
}
|
||||
$.get(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data).data
|
||||
$.balance = data.balance
|
||||
$.expiredBalance = data.expiredBalance || 0
|
||||
} else {
|
||||
console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve(data);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
function jsonParse(str) {
|
||||
if (typeof str == "string") {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user