修复神仙书院不签到的问题
This commit is contained in:
@@ -87,6 +87,7 @@ const inviteCodes = [
|
||||
.finally(() => {
|
||||
$.done();
|
||||
})
|
||||
|
||||
async function jdNian() {
|
||||
try {
|
||||
$.risk = false
|
||||
@@ -102,6 +103,7 @@ async function jdNian() {
|
||||
$.logErr(e)
|
||||
}
|
||||
}
|
||||
|
||||
function showMsg() {
|
||||
return new Promise(resolve => {
|
||||
message += `本次运行获得${$.earn}金币,当前${$.coin}金币`
|
||||
@@ -113,6 +115,7 @@ function showMsg() {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
|
||||
async function helpFriends() {
|
||||
for (let code of $.newShareCodes) {
|
||||
if (!code) continue
|
||||
@@ -120,6 +123,7 @@ async function helpFriends() {
|
||||
await $.wait(2000)
|
||||
}
|
||||
}
|
||||
|
||||
function doTask(itemToken) {
|
||||
return new Promise((resolve) => {
|
||||
$.post(taskPostUrl('mcxhd_brandcity_doTask', {itemToken: itemToken}, 'mcxhd_brandcity_doTask'), async (err, resp, data) => {
|
||||
@@ -137,8 +141,7 @@ function doTask(itemToken) {
|
||||
else {
|
||||
console.log(`任务请求结果未知`)
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
console.log(data.retMessage)
|
||||
}
|
||||
}
|
||||
@@ -150,6 +153,7 @@ function doTask(itemToken) {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function doTask2(taskToken) {
|
||||
let body = {
|
||||
"dataSource": "newshortAward",
|
||||
@@ -167,8 +171,7 @@ function doTask2(taskToken) {
|
||||
data = JSON.parse(data);
|
||||
if (data.code === "0") {
|
||||
console.log(data.toast.subTitle)
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
console.log(`任务完成失败,错误信息:${JSON.stringify(data)}`)
|
||||
}
|
||||
}
|
||||
@@ -181,6 +184,7 @@ function doTask2(taskToken) {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function getHomeData(info = false) {
|
||||
return new Promise((resolve) => {
|
||||
$.post(taskPostUrl('mcxhd_brandcity_homePage'), async (err, resp, data) => {
|
||||
@@ -198,8 +202,7 @@ function getHomeData(info=false) {
|
||||
console.log(`当前用户金币${userCoinNum}`)
|
||||
}
|
||||
$.coin = userCoinNum
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$.risk = true
|
||||
console.log(`账号被风控,无法参与活动`)
|
||||
message += `账号被风控,无法参与活动\n`
|
||||
@@ -229,7 +232,7 @@ function getTaskList(body={}) {
|
||||
if (data.retCode === '200') {
|
||||
$.tasks = data.result.tasks
|
||||
for (let vo of $.tasks) {
|
||||
if(vo.taskType==="1" || vo.taskType==="2" || vo.taskType==="5" || vo.taskType==="3") {
|
||||
if (vo.taskType === "13" || vo.taskType === "2" || vo.taskType === "5" || vo.taskType === "3") {
|
||||
// 签到,逛一逛
|
||||
for (let i = vo.times, j = 0; i < vo.maxTimes && j < vo.subItem.length; ++i, ++j) {
|
||||
console.log(`去做${vo.taskName}任务,${i + 1}/${vo.maxTimes}`)
|
||||
@@ -271,7 +274,10 @@ function getTaskList(body={}) {
|
||||
function readShareCode() {
|
||||
console.log(`开始`)
|
||||
return new Promise(async resolve => {
|
||||
$.get({url: `http://jd.turinglabs.net/api/v2/jd/immortal/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
|
||||
$.get({
|
||||
url: `http://jd.turinglabs.net/api/v2/jd/immortal/read/${randomCount}/`,
|
||||
'timeout': 10000
|
||||
}, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
@@ -292,6 +298,7 @@ function readShareCode() {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
|
||||
//格式化助力码
|
||||
function shareCodesFormat() {
|
||||
return new Promise(async resolve => {
|
||||
@@ -304,7 +311,7 @@ function shareCodesFormat() {
|
||||
const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
|
||||
$.newShareCodes = inviteCodes[tempIndex].split('@');
|
||||
}
|
||||
const readShareCodeRes = await readShareCode();
|
||||
const readShareCodeRes = [] //await readShareCode();
|
||||
if (readShareCodeRes && readShareCodeRes.code === 200) {
|
||||
$.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
|
||||
}
|
||||
@@ -312,6 +319,7 @@ function shareCodesFormat() {
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
|
||||
function requireConfig() {
|
||||
return new Promise(async resolve => {
|
||||
console.log(`开始获取${$.name}配置文件\n`);
|
||||
@@ -393,6 +401,7 @@ function taskPostUrl(function_id, body = {}, function_id2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function taskPostUrl2(function_id, body = {}, function_id2) {
|
||||
let url = `${JD_API_HOST}`;
|
||||
if (function_id2) {
|
||||
@@ -410,6 +419,7 @@ function taskPostUrl2(function_id, body = {}, function_id2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function TotalBean() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
@@ -450,6 +460,7 @@ function TotalBean() {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function safeGet(data) {
|
||||
try {
|
||||
if (typeof JSON.parse(data) == "object") {
|
||||
@@ -461,6 +472,7 @@ function safeGet(data) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function jsonParse(str) {
|
||||
if (typeof str == "string") {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user