This commit is contained in:
lxk0301
2021-02-25 18:28:31 +08:00
parent a742511b19
commit 154efb2abe

View File

@@ -48,6 +48,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
}
await requireConfig()
await getAuthorShareCode();
await getAuthorShareCode2();
for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
cookie = cookiesArr[i];
@@ -105,7 +106,7 @@ function index(info=false) {
'shareDate': data.data.result.shareDate
}
$.shareDate = data.data.result.shareDate;
$.log(`shareDate: ${$.shareDate}`)
// $.log(`shareDate: ${$.shareDate}`)
// console.log(helpInfo)
for(let task of data.data.result.taskInfos){
if (task.type === 4) {
@@ -357,9 +358,9 @@ function taskUrl(functionId, body = {}) {
}
}
function getAuthorShareCode() {
function getAuthorShareCode(url = "https://gitee.com/shylocks/updateTeam/raw/main/jd_cash.json") {
return new Promise(resolve => {
$.get({url: "https://gitee.com/shylocks/updateTeam/raw/main/jd_cash.json",headers:{
$.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"
}}, async (err, resp, data) => {
$.authorCode = [];
@@ -376,6 +377,28 @@ function getAuthorShareCode() {
})
})
}
function getAuthorShareCode2(url = "https://gitee.com/lxk0301/updateTeam/raw/master/shareCodes/jd_updateCash.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"
}}, async (err, resp, data) => {
$.authorCode2 = [];
try {
if (err) {
} else {
$.authorCode2 = JSON.parse(data)
if ($.authorCode2 && $.authorCode2.length) {
$.authorCode.push(...$.authorCode2);
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve();
}
})
})
}
function TotalBean() {
return new Promise(async resolve => {
const options = {