mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-14 22:50:47 +08:00
parent
8b5738cd3f
commit
2af4b002a7
@ -57,7 +57,29 @@ export class Main extends Template {
|
|||||||
async main(p) {
|
async main(p) {
|
||||||
let user = p.data.user;
|
let user = p.data.user;
|
||||||
let context = p.context;
|
let context = p.context;
|
||||||
if (!context.continuePrizeRuleList) {
|
let s = await this.curl({
|
||||||
|
'url': `https://api.m.jd.com/api?appid=interCenter_shopSign&loginType=2&functionId=interact_center_shopSign_getSignRecord&body={"token":"${context.token}","venderId":${context.venderId},"activityId":${context.activityId},"type":56,"actionType":7}&jsonp=jsonp1004`,
|
||||||
|
user,
|
||||||
|
algo: {
|
||||||
|
appId: '4da33',
|
||||||
|
expire: {
|
||||||
|
code: 407000007
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (this.haskey(s, 'code', 402)) {
|
||||||
|
p.log('当前不存在有效的活动')
|
||||||
|
p.context.finish = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let days = this.haskey(s, 'data.days')
|
||||||
|
let maxDay = this.column(context.continuePrizeRuleList, 'days').reduce((v, k) => {
|
||||||
|
return v += k
|
||||||
|
}, 0)
|
||||||
|
if (days>=maxDay) {
|
||||||
|
console.log(`签到已满${maxDay}天,跳出签到`, context.token, `https://shop.m.jd.com/?venderId=${context.venderId}`)
|
||||||
|
}
|
||||||
|
else {
|
||||||
let sign = await this.curl({
|
let sign = await this.curl({
|
||||||
'url': `https://api.m.jd.com`,
|
'url': `https://api.m.jd.com`,
|
||||||
form: `appid=interCenter_shopSign&loginType=2&functionId=interact_center_shopSign_signCollectGift&body={"token":"${context.token}","venderId":${context.venderId},"activityId":${context.activityId},"type":56,"actionType":7}`,
|
form: `appid=interCenter_shopSign&loginType=2&functionId=interact_center_shopSign_signCollectGift&body={"token":"${context.token}","venderId":${context.venderId},"activityId":${context.activityId},"type":56,"actionType":7}`,
|
||||||
@ -83,56 +105,6 @@ export class Main extends Template {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
let s = await this.curl({
|
|
||||||
'url': `https://api.m.jd.com/api?appid=interCenter_shopSign&loginType=2&functionId=interact_center_shopSign_getSignRecord&body={"token":"${context.token}","venderId":${context.venderId},"activityId":${context.activityId},"type":56,"actionType":7}&jsonp=jsonp1004`,
|
|
||||||
user,
|
|
||||||
algo: {
|
|
||||||
appId: '4da33',
|
|
||||||
expire: {
|
|
||||||
code: 407000007
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (this.haskey(s, 'code', 402)) {
|
|
||||||
p.log('当前不存在有效的活动')
|
|
||||||
p.context.finish = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let days = this.haskey(s, 'data.days')
|
|
||||||
let maxDay = this.column(context.continuePrizeRuleList, 'days').reduce((v, k) => {
|
|
||||||
return v += k
|
|
||||||
}, 0)
|
|
||||||
if (days>=maxDay) {
|
|
||||||
console.log(`签到已满${maxDay}天,跳出签到`, context.token, `https://shop.m.jd.com/?venderId=${context.venderId}`)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
let sign = await this.curl({
|
|
||||||
'url': `https://api.m.jd.com`,
|
|
||||||
form: `appid=interCenter_shopSign&loginType=2&functionId=interact_center_shopSign_signCollectGift&body={"token":"${context.token}","venderId":${context.venderId},"activityId":${context.activityId},"type":56,"actionType":7}`,
|
|
||||||
user,
|
|
||||||
algo: {
|
|
||||||
appId: '4da33',
|
|
||||||
version: 'latest',
|
|
||||||
status: true
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if (this.haskey(sign, 'code', 402)) {
|
|
||||||
p.log('当前不存在有效的活动')
|
|
||||||
p.context.jump = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.haskey(sign, 'code', [403030023, 200])) {
|
|
||||||
p.info.work = true
|
|
||||||
if (sign.success) {
|
|
||||||
p.log(`签到: ${days + 1}天`, context.token, context.shopName)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
p.log(sign.msg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user