Compare commits

..

No commits in common. "5d168b29ed413dba99b3b589b20dcb049368ea68" and "33ea293ff7cdd230657d1891e2e202e9f85a16bb" have entirely different histories.

3 changed files with 61 additions and 78 deletions

View File

@ -5,32 +5,24 @@ export class Main extends Template {
super() super()
this.profile = { this.profile = {
title: '京东健康', title: '京东健康',
crontab: 3, crontab: 4,
sync: 1, round: 2
verify: true
} }
} }
async prepare() { async prepare() {
} for (let i of Array(2)) {
let kit = await this.curl({
async batch(p) { 'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_bm_getKitTask&t=1738395115758`,
p = await this.getTemp(p.pid) || p 'form': `body={"channel":"jdapp","groupCode":"openkits","m_patch_appKey":"231282000001","imei":"CFFGHFCF"}`,
if (!p.encodeId) { cookie: this.tester()
for (let i of Array(2)) {
let kit = await this.curl({
'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_bm_getKitTask&t=1738395115758`,
'form': `body={"channel":"${p.channel}","groupCode":"openkits","m_patch_appKey":"${p.appKey}","imei":"CFFGHFCF"}`,
cookie: this.tester()
}
)
if (this.haskey(kit, 'result.encodeId')) {
p.encodeId = kit.result.encodeId
break
} }
)
if (this.haskey(kit, 'result.encodeId')) {
this.dict.encodeId = kit.result.encodeId
break
} }
} }
return p
} }
async main(p) { async main(p) {
@ -47,70 +39,61 @@ export class Main extends Template {
} }
} }
} }
let sign = await this.curl({ if (context.round == 0) {
'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_msoa_doTaskGw&t=1738387986997`, if (this.dict.encodeId) {
'form': `body={"infoId":"jdhHome_task","channel":"${context.channel}","appKey":"${context.appKey}","encodeId":"${context.encodeId}","imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"56789"}}`, let sign = await this.curl({
user, 'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_msoa_doTaskGw&t=1738387986997`,
algo: { 'form': `body={"infoId":"jdhHome_task","channel":"jdapp","appKey":"231282000001","encodeId":"${this.dict.encodeId}","imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"56789"}}`,
appId: "8c399", user,
expire: { algo: {
'result.code': -1 appId: "8c399"
}
} }
)
if (this.haskey(sign, 'result.result.bizCode', 12)) {
p.log("已签到")
p.info.work = true
}
else if (this.haskey(sign, 'result.result.bizCode', 2)) {
p.info.work = true
gift.bind(this)(sign)
}
else {
p.log(sign)
} }
} }
)
let msg = this.haskey(sign, 'result.result.msg') || ''
if (this.haskey(sign, 'result.result.bizCode', 12)) {
p.log("已签到")
p.info.work = true
}
else if (this.haskey(sign, 'result.result.bizCode', 2)) {
p.info.work = true
gift.bind(this)(sign)
}
else if (msg.includes('火爆')) {
p.info.jump = true
p.log('活动太火爆啦')
return
} }
else { else {
p.log(sign) let taskList = await this.curl({
} 'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_bm_queryTaskList&t=1738398013872`,
let taskList = await this.curl({ 'form': `body={"activityId":"8542","appKey":"231282000001","channel":"jdapp","imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"45678"}}`,
'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_bm_queryTaskList&t=1738398013872`, user
'form': `body={"activityId":"${context.activityId}","appKey":"${context.appKey}","channel":"${context.channel}","imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"45678"}}`, }
user )
} for (let i of this.haskey(taskList, 'data.result')) {
) for (let j of i.taskVoList) {
for (let i of this.haskey(taskList, 'data.result')) { if (j.status == 1) {
for (let j of i.taskVoList) { p.log("正在运行:", i.mainTitle || i.groupName)
if (j.status == 1) { let doTask = await this.curl({
p.log("正在运行:", i.mainTitle || i.groupName) 'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_msoa_doTaskGw&t=1738398013872`,
let doTask = await this.curl({ 'form': `body={"appKey":"${j.appKey}","channel":"jdapp","infoId":"jdhHome_task","encodeId":"${j.encodeId}","imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"45678"}}`,
'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_msoa_doTaskGw&t=1738398013872`, user
'form': `body={"appKey":"${j.appKey}","channel":"${context.channel}","infoId":"jdhHome_task","encodeId":"${j.encodeId}","imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"45678"}}`,
user
}
)
await this.wait(1000)
let award = await this.curl({
'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_msoa_sendAwardGw&t=1738398403434`,
'form': `body={"appKey":"${j.appKey}","channel":"${context.channel}","infoId":"jdhHome_task","activityId":${j.activityId},"queryToken":"${j.encodeId}","taskId":${j.id},"imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"45678"}}`,
user,
algo: {
appId: '8c399'
} }
)
await this.wait(1000)
let award = await this.curl({
'url': `https://api.m.jd.com/api?appid=jdh-middle&functionId=jdh_msoa_sendAwardGw&t=1738398403434`,
'form': `body={"appKey":"${j.appKey}","channel":"jdapp","infoId":"jdhHome_task","activityId":${j.activityId},"queryToken":"${j.encodeId}","taskId":${j.id},"imei":"CFFGHFCF","location":{"province":"16","city":"1234","district":"1234","town":"45678"}}`,
user,
algo: {
appId: '8c399'
}
}
)
try {
gift.bind(this)(award)
} catch (e) {
} }
)
let msg = this.haskey(award, 'result.message')
if (msg.includes('火爆')) {
p.info.jump = true
p.log("活动太火爆啦")
return
}
try {
gift.bind(this)(award)
} catch (e) {
} }
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long