mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-15 15:10:44 +08:00
.
This commit is contained in:
parent
4c67377343
commit
5615d40750
@ -35,7 +35,6 @@ export class Main extends Template {
|
|||||||
let react = this.jsonParse(this.match([/__react_data__\s*=\s*(.*?)\s*;\n+/,], html))
|
let react = this.jsonParse(this.match([/__react_data__\s*=\s*(.*?)\s*;\n+/,], html))
|
||||||
let signToken = this.match(/"signToken"\s*:\s*"(\w+)"/, html)
|
let signToken = this.match(/"signToken"\s*:\s*"(\w+)"/, html)
|
||||||
let status = 0
|
let status = 0
|
||||||
let isOk
|
|
||||||
if (signToken) {
|
if (signToken) {
|
||||||
let sign = await this.curl({
|
let sign = await this.curl({
|
||||||
'url': `https://api.m.jd.com/atop_channel_sign_in`,
|
'url': `https://api.m.jd.com/atop_channel_sign_in`,
|
||||||
@ -75,52 +74,48 @@ export class Main extends Template {
|
|||||||
if (i.completionFlag) {
|
if (i.completionFlag) {
|
||||||
status = 1
|
status = 1
|
||||||
p.log(`任务已经完成: ${i.assignmentName}`)
|
p.log(`任务已经完成: ${i.assignmentName}`)
|
||||||
if (i.assignmentName.includes('邀请')) {
|
|
||||||
isOk = 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p.log(`正在运行: ${i.assignmentName}`)
|
p.log(`正在运行: ${i.assignmentName}`)
|
||||||
let extraType = i.ext.extraType
|
let extraType = i.ext.extraType
|
||||||
if (i.assignmentName.includes('邀请')) {
|
if (i.assignmentName.includes('邀请')) {
|
||||||
status = 1
|
status = 1
|
||||||
isOk = 0
|
|
||||||
if (this.haskey(i, 'ext.assistTaskDetail.itemId')) {
|
if (this.haskey(i, 'ext.assistTaskDetail.itemId')) {
|
||||||
await this.setTemp(user, i.ext.assistTaskDetail.itemId, 86400000)
|
await this.setTemp(user, i.ext.assistTaskDetail.itemId, 86400000)
|
||||||
}
|
}
|
||||||
let users = Object.keys(this.dict)
|
// let users = Object.keys(this.dict)
|
||||||
if (users) {
|
// if (users) {
|
||||||
let itemId = ''
|
// let itemId = ''
|
||||||
let u = users[this.n % users.length]
|
// let u = users[this.n % users.length]
|
||||||
this.n++
|
// this.n++
|
||||||
if (u == user) {
|
// if (u == user) {
|
||||||
u = users[this.n % users.length]
|
// u = users[this.n % users.length]
|
||||||
}
|
// }
|
||||||
itemId = this.dict[u]
|
// itemId = this.dict[u]
|
||||||
let help = await this.curl({
|
// let help = await this.curl({
|
||||||
'form': `appid=jd-super-market&t=1742122986378&functionId=atop_channel_complete_task&client=m&body={"bizCode":"cn_retail_3c_digital","scenario":"sign","assignmentType":"${i.assignmentType}","encryptAssignmentId":"${i.encryptAssignmentId}","itemId":"${itemId}","assistFlag":true,"babelChannel":"ttt1","isJdApp":"1","isWx":"0"}`,
|
// 'form': `appid=jd-super-market&t=1742122986378&functionId=atop_channel_complete_task&client=m&body={"bizCode":"cn_retail_3c_digital","scenario":"sign","assignmentType":"${i.assignmentType}","encryptAssignmentId":"${i.encryptAssignmentId}","itemId":"${itemId}","assistFlag":true,"babelChannel":"ttt1","isJdApp":"1","isWx":"0"}`,
|
||||||
user,
|
// user,
|
||||||
algo: {
|
// algo: {
|
||||||
appId: '51113'
|
// appId: '51113'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
let subCode = this.haskey(help, 'data.subCode')
|
// let subCode = this.haskey(help, 'data.subCode')
|
||||||
if (subCode == '104') {
|
// if (subCode == '104') {
|
||||||
p.log("您已经助力过了")
|
// p.log("您已经助力过了")
|
||||||
isOk = 1
|
// isOk = 1
|
||||||
}
|
// }
|
||||||
else if (subCode == '0') {
|
// else if (subCode == '0') {
|
||||||
p.log("助力成功")
|
// p.log("助力成功")
|
||||||
isOk = 1
|
// isOk = 1
|
||||||
}
|
// }
|
||||||
if (subCode == '109') {
|
// if (subCode == '109') {
|
||||||
p.log("不能自己给自己助力")
|
// p.log("不能自己给自己助力")
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
isOk = 1
|
// isOk = 1
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
else if (this.haskey(i, `ext.${i.ext.extraType}`)) {
|
else if (this.haskey(i, `ext.${i.ext.extraType}`)) {
|
||||||
let extra = i.ext[extraType]
|
let extra = i.ext[extraType]
|
||||||
|
|||||||
@ -35,7 +35,6 @@ export class Main extends Template {
|
|||||||
let react = this.jsonParse(this.match([/__react_data__\s*=\s*(.*?)\s*;\n+/,], html))
|
let react = this.jsonParse(this.match([/__react_data__\s*=\s*(.*?)\s*;\n+/,], html))
|
||||||
let signToken = this.match(/"signToken"\s*:\s*"(\w+)"/, html)
|
let signToken = this.match(/"signToken"\s*:\s*"(\w+)"/, html)
|
||||||
let status = 0
|
let status = 0
|
||||||
let isOk
|
|
||||||
if (signToken) {
|
if (signToken) {
|
||||||
let sign = await this.curl({
|
let sign = await this.curl({
|
||||||
'url': `https://api.m.jd.com/atop_channel_sign_in`,
|
'url': `https://api.m.jd.com/atop_channel_sign_in`,
|
||||||
@ -78,52 +77,26 @@ export class Main extends Template {
|
|||||||
if (i.completionFlag) {
|
if (i.completionFlag) {
|
||||||
status = 1
|
status = 1
|
||||||
p.log(`任务已经完成: ${i.assignmentName}`)
|
p.log(`任务已经完成: ${i.assignmentName}`)
|
||||||
if (i.assignmentName.includes('邀请')) {
|
|
||||||
isOk = 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p.log(`正在运行: ${i.assignmentName}`)
|
p.log(`正在运行: ${i.assignmentName}`)
|
||||||
let extraType = i.ext.extraType
|
let extraType = i.ext.extraType
|
||||||
if (i.assignmentName.includes('邀请')) {
|
if (i.assignmentName.includes('邀请')) {
|
||||||
status = 1
|
status = 1
|
||||||
isOk = 0
|
|
||||||
if (this.haskey(i, 'ext.assistTaskDetail.itemId')) {
|
if (this.haskey(i, 'ext.assistTaskDetail.itemId')) {
|
||||||
await this.setTemp(user, i.ext.assistTaskDetail.itemId, 86400000)
|
await this.setTemp(user, i.ext.assistTaskDetail.itemId, 86400000)
|
||||||
}
|
}
|
||||||
let users = Object.keys(this.dict)
|
// let users = Object.keys(this.dict)
|
||||||
if (users) {
|
// if (users) {
|
||||||
let itemId = ''
|
// let itemId = ''
|
||||||
let u = users[this.n % users.length]
|
// this.n++
|
||||||
this.n++
|
// itemId = this.dict[users[this.n % users.length]]
|
||||||
if (u == user) {
|
// let help = await this.curl({
|
||||||
u = users[this.n % users.length]
|
// 'form': `appid=jd-super-market&t=1742122986378&functionId=atop_channel_complete_task&client=m&body={"bizCode":"cn_retail_jdsupermarket","scenario":"sign","assignmentType":"${i.assignmentType}","encryptAssignmentId":"${i.encryptAssignmentId}","itemId":"${itemId}","assistFlag":true,"babelChannel":"ttt1","isJdApp":"1","isWx":"0"}`,
|
||||||
}
|
// user
|
||||||
itemId = this.dict[u]
|
// }
|
||||||
let help = await this.curl({
|
// )
|
||||||
'form': `appid=jd-super-market&t=1742122986378&functionId=atop_channel_complete_task&client=m&body={"bizCode":"cn_retail_jdsupermarket","scenario":"sign","assignmentType":"${i.assignmentType}","encryptAssignmentId":"${i.encryptAssignmentId}","itemId":"${itemId}","assistFlag":true,"babelChannel":"ttt1","isJdApp":"1","isWx":"0"}`,
|
// }
|
||||||
user,
|
|
||||||
algo: {
|
|
||||||
appId: '51113'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
let subCode = this.haskey(help, 'data.subCode')
|
|
||||||
if (subCode == '104') {
|
|
||||||
p.log("您已经助力过了")
|
|
||||||
isOk = 1
|
|
||||||
}
|
|
||||||
else if (subCode == '0') {
|
|
||||||
p.log("助力成功")
|
|
||||||
isOk = 1
|
|
||||||
}
|
|
||||||
if (subCode == '109') {
|
|
||||||
p.log("不能自己给自己助力")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
isOk = 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (this.haskey(i, `ext.${i.ext.extraType}`)) {
|
else if (this.haskey(i, `ext.${i.ext.extraType}`)) {
|
||||||
let extra = i.ext[extraType]
|
let extra = i.ext[extraType]
|
||||||
@ -209,4 +182,3 @@ export class Main extends Template {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user