1
0
mirror of https://github.com/okyyds/yyds.git synced 2026-07-12 11:11:18 +08:00
This commit is contained in:
yyds
2022-02-26 00:50:53 +08:00
parent 4b57e5c001
commit 0771f5f3b9

View File

@@ -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])
@@ -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(),