mirror of
https://github.com/okyyds/yyds.git
synced 2026-07-13 20:01:18 +08:00
yyds
This commit is contained in:
38
jd_cfd.js
38
jd_cfd.js
@@ -38,8 +38,9 @@ $.result = [];
|
|||||||
$.shareCodes = [];
|
$.shareCodes = [];
|
||||||
let cookiesArr = [], cookie = '', token = '';
|
let cookiesArr = [], cookie = '', token = '';
|
||||||
let UA, UAInfo = {};
|
let UA, UAInfo = {};
|
||||||
|
let nowTimes;
|
||||||
const randomCount = $.isNode() ? 20 : 3;
|
const randomCount = $.isNode() ? 20 : 3;
|
||||||
$.appId = "92a36";
|
$.appId = 10032;
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
Object.keys(jdCookieNode).forEach((item) => {
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
cookiesArr.push(jdCookieNode[item])
|
cookiesArr.push(jdCookieNode[item])
|
||||||
@@ -120,6 +121,7 @@ if ($.isNode()) {
|
|||||||
|
|
||||||
async function cfd() {
|
async function cfd() {
|
||||||
try {
|
try {
|
||||||
|
nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000)
|
||||||
let beginInfo = await getUserInfo();
|
let beginInfo = await getUserInfo();
|
||||||
if (beginInfo.LeadInfo.dwLeadType === 2) {
|
if (beginInfo.LeadInfo.dwLeadType === 2) {
|
||||||
console.log(`还未开通活动,尝试初始化`)
|
console.log(`还未开通活动,尝试初始化`)
|
||||||
@@ -134,10 +136,6 @@ async function cfd() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!beginInfo.MarkList.daily_task_win) {
|
|
||||||
await setMark()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 寻宝
|
// 寻宝
|
||||||
console.log(`寻宝`)
|
console.log(`寻宝`)
|
||||||
let XBDetail = beginInfo.XbStatus.XBDetail.filter((x) => x.dwRemainCnt !== 0)
|
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) {
|
function getUserInfo(showInvite = true) {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
@@ -1163,8 +1142,7 @@ function getUserInfo(showInvite = true) {
|
|||||||
LeadInfo = {},
|
LeadInfo = {},
|
||||||
StoryInfo = {},
|
StoryInfo = {},
|
||||||
Business = {},
|
Business = {},
|
||||||
XbStatus = {},
|
XbStatus = {}
|
||||||
MarkList = {}
|
|
||||||
} = data;
|
} = data;
|
||||||
if (showInvite) {
|
if (showInvite) {
|
||||||
console.log(`获取用户信息:${sErrMsg}\n${$.showLog ? data : ""}`);
|
console.log(`获取用户信息:${sErrMsg}\n${$.showLog ? data : ""}`);
|
||||||
@@ -1185,8 +1163,7 @@ function getUserInfo(showInvite = true) {
|
|||||||
dwLandLvl,
|
dwLandLvl,
|
||||||
LeadInfo,
|
LeadInfo,
|
||||||
StoryInfo,
|
StoryInfo,
|
||||||
XbStatus,
|
XbStatus
|
||||||
MarkList
|
|
||||||
};
|
};
|
||||||
resolve({
|
resolve({
|
||||||
buildInfo,
|
buildInfo,
|
||||||
@@ -1195,8 +1172,7 @@ function getUserInfo(showInvite = true) {
|
|||||||
strMyShareId,
|
strMyShareId,
|
||||||
LeadInfo,
|
LeadInfo,
|
||||||
StoryInfo,
|
StoryInfo,
|
||||||
XbStatus,
|
XbStatus
|
||||||
MarkList
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} 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'
|
'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7'
|
||||||
},
|
},
|
||||||
'body': JSON.stringify({
|
'body': JSON.stringify({
|
||||||
"version": "3.0",
|
"version": "1.0",
|
||||||
"fp": $.fingerprint,
|
"fp": $.fingerprint,
|
||||||
"appId": $.appId.toString(),
|
"appId": $.appId.toString(),
|
||||||
"timestamp": Date.now(),
|
"timestamp": Date.now(),
|
||||||
|
|||||||
Reference in New Issue
Block a user