Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
indextank committed Oct 31, 2021
1 parent d2462f4 commit 0f0352e
Show file tree
Hide file tree
Showing 23 changed files with 4,730 additions and 1,095 deletions.
52 changes: 26 additions & 26 deletions backUp/jd_city.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,37 +254,37 @@ function city_lotteryAward() {
})
})
}
function readShareCode(num=3) {
return new Promise(async resolve => {
$.get({url: `https://api.jdsharecode.xyz/api/city/${num}`, 'timeout': 10000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
} else {
if (data) {
data = JSON.parse(data);
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
await $.wait(10000);
resolve()
})
}
// function readShareCode(num=3) {
// return new Promise(async resolve => {
// $.get({url: `https://api.jdsharecode.xyz/api/city/${num}`, 'timeout': 10000}, (err, resp, data) => {
// try {
// if (err) {
// console.log(`${JSON.stringify(err)}`)
// console.log(`${$.name} API请求失败,请检查网路重试`)
// } else {
// if (data) {
// data = JSON.parse(data);
// }
// }
// } catch (e) {
// $.logErr(e, resp)
// } finally {
// resolve(data);
// }
// })
// await $.wait(10000);
// resolve()
// })
// }
//格式化助力码
function shareCodesFormat() {
return new Promise(async resolve => {
// console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
$.newShareCodes = []
const readShareCodeRes = await readShareCode(3);
if (readShareCodeRes && readShareCodeRes.code === 200) {
pool = readShareCodeRes.data || [];
}
// const readShareCodeRes = await readShareCode(3);
// if (readShareCodeRes && readShareCodeRes.code === 200) {
// pool = readShareCodeRes.data || [];
// }
if ($.isNode()) {
if (process.env.JD_CITY_EXCHANGE) {
exchangeFlag = process.env.JD_CITY_EXCHANGE || exchangeFlag;
Expand Down
56 changes: 28 additions & 28 deletions backUp/jd_crazy_joy.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,30 +579,30 @@ function taskUrl(functionId, body = '') {
}
}
}
function readShareCode() {
console.log(`开始`)
return new Promise(async resolve => {
$.get({ url: `https://code.chiang.fun/api/v1/jd/jdcrazyjoy/read/${randomCount}/`, 'timeout': 10000 }, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
} else {
if (data) {
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
data = JSON.parse(data);
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
await $.wait(10000);
resolve()
})
}
// function readShareCode() {
// console.log(`开始`)
// return new Promise(async resolve => {
// $.get({ url: `https://code.chiang.fun/api/v1/jd/jdcrazyjoy/read/${randomCount}/`, 'timeout': 10000 }, (err, resp, data) => {
// try {
// if (err) {
// console.log(`${JSON.stringify(err)}`)
// console.log(`${$.name} API请求失败,请检查网路重试`)
// } else {
// if (data) {
// console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
// data = JSON.parse(data);
// }
// }
// } catch (e) {
// $.logErr(e, resp)
// } finally {
// resolve(data);
// }
// })
// await $.wait(10000);
// resolve()
// })
// }
//格式化助力码
function shareCodesFormat() {
return new Promise(async resolve => {
Expand All @@ -615,10 +615,10 @@ function shareCodesFormat() {
const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
$.newShareCodes = inviteCodes[tempIndex].split('@');
}
const readShareCodeRes = await readShareCode();
if (readShareCodeRes && readShareCodeRes.code === 200) {
$.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
}
// const readShareCodeRes = await readShareCode();
// if (readShareCodeRes && readShareCodeRes.code === 200) {
// $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
// }
console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
resolve();
})
Expand Down
7 changes: 4 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"jd_super_redrain": 1,
"jd_super_redrain": 3,
"jd_carnivalcity": 6,
"jd_fruit":[6, 12 ,18],
"jx_sign": [8, 13],
Expand Down Expand Up @@ -29,7 +29,7 @@
"jd_kd": [3],
"jd_live": [12, 13, 14],
"jd_lsj": [6, 8, 10, 12, 14, 16, 18, 20, 22],
"jd_mohe": 4,
"jd_red": [5,23],
"jd_moneyTree_help": [6, 10, 14, 18, 22],
"jd_moneyTree": [6, 14, 22],
"jd_ms": [7],
Expand Down Expand Up @@ -68,7 +68,7 @@
"jd_lol": [10],
"jd_jika": [9,23],
"jd_qjd": [2,22],
"jd_city_exchange": [23],
"jd_cjhz": [5,23],
"jd_bean_change": [17],
"jd_bookshop": [8, 12, 18],
"jd_jdfactory": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
Expand All @@ -79,6 +79,7 @@
"jd_price": [23],
"jd_joy_steal": 3,
"jd_kyd": [17, 21],
"jd_hotNeight": [23],
"params":
{
"global":
Expand Down
44 changes: 22 additions & 22 deletions jd_carnivalcity_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,28 +253,28 @@ function getAuthorShareCode(url) {
})
}

function readShareCode() {
return new Promise(async resolve => {
$.get({url: `http://transfer.nz.lu/carnivalcity`, 'timeout': 20000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
} else {
if (data) {
data = JSON.parse(data);
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
await $.wait(20000);
resolve()
})
}
// function readShareCode() {
// return new Promise(async resolve => {
// $.get({url: `http://transfer.nz.lu/carnivalcity`, 'timeout': 20000}, (err, resp, data) => {
// try {
// if (err) {
// console.log(`${JSON.stringify(err)}`)
// console.log(`${$.name} API请求失败,请检查网路重试`)
// } else {
// if (data) {
// data = JSON.parse(data);
// }
// }
// } catch (e) {
// $.logErr(e, resp)
// } finally {
// resolve(data);
// }
// })
// await $.wait(20000);
// resolve()
// })
// }
//格式化助力码
function shareCodesFormat() {
return new Promise(async resolve => {
Expand Down
56 changes: 28 additions & 28 deletions jd_cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,30 +491,30 @@ function showMsg() {
resolve()
})
}
function readShareCode() {
console.log(`开始`)
return new Promise(async resolve => {
$.get({url: `http://code.chiang.fun/api/v1/jd/jdcash/read/${randomCount}/`, 'timeout': 30000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
} else {
if (data) {
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
data = JSON.parse(data);
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
await $.wait(30000);
resolve()
})
}
// function readShareCode() {
// console.log(`开始`)
// return new Promise(async resolve => {
// $.get({url: `http://code.chiang.fun/api/v1/jd/jdcash/read/${randomCount}/`, 'timeout': 30000}, (err, resp, data) => {
// try {
// if (err) {
// console.log(`${JSON.stringify(err)}`)
// console.log(`${$.name} API请求失败,请检查网路重试`)
// } else {
// if (data) {
// console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
// data = JSON.parse(data);
// }
// }
// } catch (e) {
// $.logErr(e, resp)
// } finally {
// resolve(data);
// }
// })
// await $.wait(30000);
// resolve()
// })
// }
//格式化助力码
function shareCodesFormat() {
return new Promise(async resolve => {
Expand All @@ -529,10 +529,10 @@ function shareCodesFormat() {
let authorCode = deepCopy($.authorCode)
$.newShareCodes = [...(authorCode.map((item, index) => authorCode[index] = item['inviteCode'])), ...$.newShareCodes];
}
const readShareCodeRes = await readShareCode();
if (readShareCodeRes && readShareCodeRes.code === 200) {
$.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
}
// const readShareCodeRes = await readShareCode();
// if (readShareCodeRes && readShareCodeRes.code === 200) {
// $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
// }
$.newShareCodes.map((item, index) => $.newShareCodes[index] = { "inviteCode": item, "shareDate": $.shareDate })
console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
resolve();
Expand Down
58 changes: 29 additions & 29 deletions jd_cfd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1645,29 +1645,29 @@ function showMsg() {
});
}

function readShareCode() {
return new Promise(async resolve => {
$.get({url: `http://${randomString(40)}.transfer.nz.lu/cfd`, timeout: 10000}, (err, resp, data) => {
try {
if (err) {
console.log(JSON.stringify(err))
console.log(`${$.name} readShareCode API请求失败,请检查网路重试`)
} else {
if (data) {
console.log(`\n随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
data = JSON.parse(data);
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
await $.wait(10000);
resolve()
})
}
// function readShareCode() {
// return new Promise(async resolve => {
// $.get({url: `http://${randomString(40)}.transfer.nz.lu/cfd`, timeout: 10000}, (err, resp, data) => {
// try {
// if (err) {
// console.log(JSON.stringify(err))
// console.log(`${$.name} readShareCode API请求失败,请检查网路重试`)
// } else {
// if (data) {
// console.log(`\n随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
// data = JSON.parse(data);
// }
// }
// } catch (e) {
// $.logErr(e, resp)
// } finally {
// resolve(data);
// }
// })
// await $.wait(10000);
// resolve()
// })
// }
function uploadShareCode(code) {
return new Promise(async resolve => {
$.post({url: `http://${randomString(40)}.transfer.nz.lu/upload/cfd?code=${code}&ptpin=${encodeURIComponent(encodeURIComponent($.UserName))}`, timeout: 10000}, (err, resp, data) => {
Expand Down Expand Up @@ -1706,12 +1706,12 @@ function uploadShareCode(code) {
function shareCodesFormat() {
return new Promise(async resolve => {
$.newShareCodes = []
const readShareCodeRes = await readShareCode();
if (readShareCodeRes && readShareCodeRes.code === 200) {
$.newShareCodes = [...new Set([...$.shareCodes, ...$.strMyShareIds, ...(readShareCodeRes.data || [])])];
} else {
$.newShareCodes = [...new Set([...$.shareCodes, ...$.strMyShareIds])];
}
// const readShareCodeRes = await readShareCode();
// if (readShareCodeRes && readShareCodeRes.code === 200) {
// $.newShareCodes = [...new Set([...$.shareCodes, ...$.strMyShareIds, ...(readShareCodeRes.data || [])])];
// } else {
// $.newShareCodes = [...new Set([...$.shareCodes, ...$.strMyShareIds])];
// }
console.log(`您将要助力的好友${JSON.stringify($.newShareCodes)}`)
resolve();
})
Expand Down
Loading

0 comments on commit 0f0352e

Please sign in to comment.