This commit is contained in:
lxk0301
2021-02-25 18:28:31 +08:00
parent 3ac5730cb9
commit b69d4f6cf7

View File

@@ -48,6 +48,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
} }
await requireConfig() await requireConfig()
await getAuthorShareCode(); await getAuthorShareCode();
await getAuthorShareCode2();
for (let i = 0; i < cookiesArr.length; i++) { for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) { if (cookiesArr[i]) {
cookie = cookiesArr[i]; cookie = cookiesArr[i];
@@ -105,7 +106,7 @@ function index(info=false) {
'shareDate': data.data.result.shareDate 'shareDate': data.data.result.shareDate
} }
$.shareDate = data.data.result.shareDate; $.shareDate = data.data.result.shareDate;
$.log(`shareDate: ${$.shareDate}`) // $.log(`shareDate: ${$.shareDate}`)
// console.log(helpInfo) // console.log(helpInfo)
for(let task of data.data.result.taskInfos){ for(let task of data.data.result.taskInfos){
if (task.type === 4) { 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 => { 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" "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) => { }}, async (err, resp, data) => {
$.authorCode = []; $.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() { function TotalBean() {
return new Promise(async resolve => { return new Promise(async resolve => {
const options = { const options = {