This commit is contained in:
lxk0301
2021-04-07 17:41:52 +08:00
parent af88257686
commit 009a810d25
5 changed files with 20 additions and 11 deletions

View File

@ -370,7 +370,7 @@ function taskUrl(functionId, body = {}) {
}
}
function getAuthorShareCode(url = "https://gitee.com/shylocks/updateTeam/raw/main/jd_cash.json") {
function getAuthorShareCode(url = "http://qr6pzoy01.hn-bkt.clouddn.com/jd_cash.json") {
return new Promise(resolve => {
$.get({url, headers:{
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88"

File diff suppressed because one or more lines are too long

View File

@ -966,7 +966,7 @@ async function tuanActivity() {
}
}
async function joinLeaderTuan() {
let res = await updateTuanIdsCDN(), res2 = await updateTuanIdsCDN("https://gitee.com/shylocks/updateTeam/raw/main/jd_updateFactoryTuanId.json")
let res = await updateTuanIdsCDN(), res2 = await updateTuanIdsCDN("http://qr6pzoy01.hn-bkt.clouddn.com/factory.json")
$.authorTuanIds = [...(res && res.tuanIds || []),...(res2 && res2.tuanIds || [])]
if ($.authorTuanIds && $.authorTuanIds.length) {
console.log(`\n参加作者的团`);
@ -1188,7 +1188,7 @@ function tuanAward(activeId, tuanId, isTuanLeader = true) {
})
}
function updateTuanIdsCDN(url = 'https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_updateFactoryTuanId.json') {
function updateTuanIdsCDN(url = 'https://raw.githubusercontent.com/gitupdate/updateTeam/master/shareCodes/jd_updateFactoryTuanId.json') {
return new Promise(async resolve => {
$.get({url,
timeout: 200000,
@ -1206,11 +1206,11 @@ function updateTuanIdsCDN(url = 'https://cdn.jsdelivr.net/gh/gitupdate/updateTea
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data || []);
resolve(data);
}
})
await $.wait(20000)
resolve([]);
resolve();
})
}
@ -1321,12 +1321,20 @@ function shareCodesFormat() {
}
function requireConfig() {
return new Promise(async resolve => {
await updateTuanIdsCDN('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_updateFactoryTuanId.json');
await updateTuanIdsCDN();
if ($.tuanConfigs && $.tuanConfigs['tuanActiveId']) {
tuanActiveId = $.tuanConfigs['tuanActiveId'];
console.log(`拼团活动ID: 获取成功 ${tuanActiveId}`)
} else {
console.log(`拼团活动ID获取失败`)
if (!$.tuanConfigs) {
await updateTuanIdsCDN('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_updateFactoryTuanId.json');
if ($.tuanConfigs && $.tuanConfigs['tuanActiveId']) {
tuanActiveId = $.tuanConfigs['tuanActiveId'];
console.log(`拼团活动ID: 获取成功 ${tuanActiveId}`)
} else {
console.log(`拼团活动ID获取失败将采取脚本内置活动ID`)
}
}
}
console.log(`开始获取${$.name}配置文件\n`);
//Node.js用户请在jdCookie.js处填写京东ck;

View File

@ -47,8 +47,8 @@ let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset() *
!(async () => {
$.tuanList = []
await requireConfig();
// if (helpAuthor) await getAuthorShareCode('https://gitee.com/shylocks/updateTeam/raw/main/jd_zz.json');
if (helpAuthor) await getAuthorShareCode('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_zz.json');
if (helpAuthor) await getAuthorShareCode('http://qr6pzoy01.hn-bkt.clouddn.com/jd_zz.json');
if (helpAuthor) await getAuthorShareCode('https://raw.githubusercontent.com/gitupdate/updateTeam/master/shareCodes/jd_zz.json');
if (!cookiesArr[0]) {
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
return;
@ -81,6 +81,7 @@ let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset() *
await notify.sendNotify($.name, allMessage);
}
}
console.log(`开始账号内部互助 赚京豆-瓜分京豆 活动(优先内部账号互助如有剩余则给作者lxk0301助力)`)
for (let i = 0; i < cookiesArr.length; i++) {
$.canHelp = true
if (cookiesArr[i]) {

File diff suppressed because one or more lines are too long