yyds
parent
0fe20f2614
commit
8d304e27ad
40
jd_cfd.js
40
jd_cfd.js
|
@ -38,8 +38,9 @@ $.result = [];
|
|||
$.shareCodes = [];
|
||||
let cookiesArr = [], cookie = '', token = '';
|
||||
let UA, UAInfo = {};
|
||||
let nowTimes;
|
||||
const randomCount = $.isNode() ? 20 : 3;
|
||||
$.appId = "92a36";
|
||||
$.appId = 10032;
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
cookiesArr.push(jdCookieNode[item])
|
||||
|
@ -89,7 +90,7 @@ if ($.isNode()) {
|
|||
// await $.wait(1000)
|
||||
// res = await getAuthorShareCode('https://cdn.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/cfd.json')
|
||||
// }
|
||||
$.strMyShareIds = [...(res && res.shareId || [])]
|
||||
// $.strMyShareIds = [...(res && res.shareId || [])]
|
||||
await shareCodesFormat()
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
cookie = cookiesArr[i];
|
||||
|
@ -120,6 +121,7 @@ if ($.isNode()) {
|
|||
|
||||
async function cfd() {
|
||||
try {
|
||||
nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000)
|
||||
let beginInfo = await getUserInfo();
|
||||
if (beginInfo.LeadInfo.dwLeadType === 2) {
|
||||
console.log(`还未开通活动,尝试初始化`)
|
||||
|
@ -134,10 +136,6 @@ async function cfd() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!beginInfo.MarkList.daily_task_win) {
|
||||
await setMark()
|
||||
}
|
||||
|
||||
// 寻宝
|
||||
console.log(`寻宝`)
|
||||
let XBDetail = beginInfo.XbStatus.XBDetail.filter((x) => x.dwRemainCnt !== 0)
|
||||
|
@ -1123,25 +1121,6 @@ function getAuthorShareCode(url) {
|
|||
})
|
||||
}
|
||||
|
||||
function setMark() {
|
||||
return new Promise(resolve => {
|
||||
$.get(taskUrl("user/SetMark", `strMark=daily_task_win&strValue=1&dwType=1`), (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`);
|
||||
console.log(`${$.name} SetMark API请求失败,请检查网路重试`);
|
||||
} else {
|
||||
data = JSON.parse(data.replace(/\n/g, "").match(new RegExp(/jsonpCBK.?\((.*);*\)/))[1]);
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
} finally{
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
function getUserInfo(showInvite = true) {
|
||||
return new Promise(async (resolve) => {
|
||||
|
@ -1163,8 +1142,7 @@ function getUserInfo(showInvite = true) {
|
|||
LeadInfo = {},
|
||||
StoryInfo = {},
|
||||
Business = {},
|
||||
XbStatus = {},
|
||||
MarkList = {}
|
||||
XbStatus = {}
|
||||
} = data;
|
||||
if (showInvite) {
|
||||
console.log(`获取用户信息:${sErrMsg}\n${$.showLog ? data : ""}`);
|
||||
|
@ -1185,8 +1163,7 @@ function getUserInfo(showInvite = true) {
|
|||
dwLandLvl,
|
||||
LeadInfo,
|
||||
StoryInfo,
|
||||
XbStatus,
|
||||
MarkList
|
||||
XbStatus
|
||||
};
|
||||
resolve({
|
||||
buildInfo,
|
||||
|
@ -1195,8 +1172,7 @@ function getUserInfo(showInvite = true) {
|
|||
strMyShareId,
|
||||
LeadInfo,
|
||||
StoryInfo,
|
||||
XbStatus,
|
||||
MarkList
|
||||
XbStatus
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -1740,7 +1716,7 @@ async function requestAlgo() {
|
|||
'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7'
|
||||
},
|
||||
'body': JSON.stringify({
|
||||
"version": "3.0",
|
||||
"version": "1.0",
|
||||
"fp": $.fingerprint,
|
||||
"appId": $.appId.toString(),
|
||||
"timestamp": Date.now(),
|
||||
|
|
Loading…
Reference in New Issue