This commit is contained in:
Faker
2022-04-20 11:42:53 +08:00
parent 40470006d4
commit aa6e088da4
7 changed files with 84 additions and 78 deletions

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])
@@ -83,12 +84,12 @@ if ($.isNode()) {
await $.wait(2000);
}
}
// let res = await getAuthorShareCode('https://raw.githubusercontent.com/Aaron-lv/updateTeam/master/shareCodes/cfd.json')
// if (!res) {
// $.http.get({url: 'https://purge.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/cfd.json'}).then((resp) => {}).catch((e) => console.log('刷新CDN异常', e));
// await $.wait(1000)
// res = await getAuthorShareCode('https://cdn.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/cfd.json')
// }
let res = await getAuthorShareCode('https://raw.githubusercontent.com/Aaron-lv/updateTeam/master/shareCodes/cfd.json')
if (!res) {
$.http.get({url: 'https://purge.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/cfd.json'}).then((resp) => {}).catch((e) => console.log('刷新CDN异常', e));
await $.wait(1000)
res = await getAuthorShareCode('https://cdn.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/cfd.json')
}
$.strMyShareIds = [...(res && res.shareId || [])]
await shareCodesFormat()
for (let i = 0; i < cookiesArr.length; 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) {
@@ -1516,7 +1492,7 @@ function taskUrl(function_path, body = '', dwEnv = 7) {
"User-Agent": UA,
"Accept-Language": "zh-CN,zh-Hans;q=0.9",
"Referer": "https://st.jingxi.com/",
"Cookie": cookie
"Cookie": cookie + "cid=4"
}
}
}
@@ -1534,7 +1510,7 @@ function taskListUrl(function_path, body = '', bizCode = 'jxbfd') {
"User-Agent": UA,
"Accept-Language": "zh-CN,zh-Hans;q=0.9",
"Referer": "https://st.jingxi.com/",
"Cookie": cookie
"Cookie": cookie + "cid=4"
}
}
}
@@ -1574,7 +1550,7 @@ function showMsg() {
function readShareCode() {
return new Promise(async resolve => {
$.get({url: ``, timeout: 30 * 1000}, (err, resp, data) => {
$.get({url: `https://transfer.nz.lu/cfd`, timeout: 30 * 1000}, (err, resp, data) => {
try {
if (err) {
console.log(JSON.stringify(err))
@@ -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(),