update
This commit is contained in:
@@ -20,7 +20,7 @@ const $ = new Env('宠汪汪偷好友积分与狗粮');
|
|||||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
|
let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000);
|
||||||
//IOS等用户直接用NobyDa的jd cookie
|
//IOS等用户直接用NobyDa的jd cookie
|
||||||
let cookiesArr = [], cookie = '';
|
let cookiesArr = [], cookie = '';
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
@@ -42,7 +42,6 @@ let message = '', subTitle = '';
|
|||||||
let jdNotify = false;//是否开启静默运行,false关闭静默运行(即通知),true打开静默运行(即不通知)
|
let jdNotify = false;//是否开启静默运行,false关闭静默运行(即通知),true打开静默运行(即不通知)
|
||||||
let jdJoyHelpFeed = false;//是否给好友喂食,false为不给喂食,true为给好友喂食,默认不给好友喂食
|
let jdJoyHelpFeed = false;//是否给好友喂食,false为不给喂食,true为给好友喂食,默认不给好友喂食
|
||||||
let jdJoyStealCoin = true;//是否偷好友积分与狗粮,false为否,true为是,默认是偷
|
let jdJoyStealCoin = true;//是否偷好友积分与狗粮,false为否,true为是,默认是偷
|
||||||
const weAppUrl = 'https://draw.jdfcloud.com//pet';
|
|
||||||
const JD_API_HOST = 'https://jdjoy.jd.com/pet'
|
const JD_API_HOST = 'https://jdjoy.jd.com/pet'
|
||||||
!(async () => {
|
!(async () => {
|
||||||
if (!cookiesArr[0]) {
|
if (!cookiesArr[0]) {
|
||||||
@@ -80,10 +79,15 @@ const JD_API_HOST = 'https://jdjoy.jd.com/pet'
|
|||||||
$.done();
|
$.done();
|
||||||
})
|
})
|
||||||
async function jdJoySteal() {
|
async function jdJoySteal() {
|
||||||
|
try {
|
||||||
|
$.helpFood = 0;
|
||||||
|
$.stealFriendCoin = 0;
|
||||||
|
$.stealFood = 0;
|
||||||
await getFriends();
|
await getFriends();
|
||||||
|
// $.log('data', JSON.stringify($.getFriendsData.datas))
|
||||||
if ($.getFriendsData && $.getFriendsData.success) {
|
if ($.getFriendsData && $.getFriendsData.success) {
|
||||||
message += `【京东账号${$.index}】${$.nickName}\n`;
|
message += `【京东账号${$.index}】${$.nickName}\n`;
|
||||||
await getCoinChanges();
|
await getCoinChanges();//查询喂食好友和偷好友积分是否已达上限
|
||||||
if ($.getFriendsData && $.getFriendsData.datas && $.getFriendsData.datas.length > 0) {
|
if ($.getFriendsData && $.getFriendsData.datas && $.getFriendsData.datas.length > 0) {
|
||||||
const { lastPage } = $.getFriendsData.page;
|
const { lastPage } = $.getFriendsData.page;
|
||||||
console.log('lastPage', lastPage)
|
console.log('lastPage', lastPage)
|
||||||
@@ -100,9 +104,6 @@ async function jdJoySteal() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(`共${$.allFriends.length}个好友`);
|
console.log(`共${$.allFriends.length}个好友`);
|
||||||
$.helpFood = 0;
|
|
||||||
$.stealFriendCoin = 0;
|
|
||||||
$.stealFood = 0;
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
stealFriendCoinFun(),//偷积分
|
stealFriendCoinFun(),//偷积分
|
||||||
stealFriendsFood(),//偷好友狗粮
|
stealFriendsFood(),//偷好友狗粮
|
||||||
@@ -112,8 +113,12 @@ async function jdJoySteal() {
|
|||||||
} else {
|
} else {
|
||||||
message += `${$.getFriendsData && $.getFriendsData.errorMessage}\n`;
|
message += `${$.getFriendsData && $.getFriendsData.errorMessage}\n`;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
async function stealFriendsFood() {
|
async function stealFriendsFood() {
|
||||||
|
if (nowTimes.getHours() < 6) return
|
||||||
let jdJoyStealCoinTemp;
|
let jdJoyStealCoinTemp;
|
||||||
if ($.isNode() && process.env.jdJoyStealCoin) {
|
if ($.isNode() && process.env.jdJoyStealCoin) {
|
||||||
jdJoyStealCoinTemp = `${process.env.jdJoyStealCoin}` === 'true';
|
jdJoyStealCoinTemp = `${process.env.jdJoyStealCoin}` === 'true';
|
||||||
|
Reference in New Issue
Block a user