Skip to content

Commit c22cf1b

Browse files
committed
更新[分期乐]通知样式
1 parent a49467f commit c22cf1b

1 file changed

Lines changed: 55 additions & 26 deletions

File tree

‎fenqile/fenqile.js‎

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,79 @@ const senku = init()
66
const signurlVal = senku.getdata(signurlKey)
77
const signheaderVal = senku.getdata(signheaderKey)
88
const signBodyVal = senku.getdata(signbodyKey)
9-
let subTitle = ``
10-
let detail = ``
9+
const signinfo = {}
10+
1111

1212
check()
1313

1414
function check(){
1515
signDaily()
1616
sign()
17+
checkin()
1718
}
1819

1920
function sign() {
2021
const url = { url: signurlVal, headers: JSON.parse(signheaderVal), body: signBodyVal }
2122
senku.post(url, (error, response, data) => {
22-
senku.log(`${cookieName}, data: ${data}`)
23-
const res = JSON.parse(data)
24-
if (res.data.result == 0) {
25-
subTitle += `,签到领乐星:失败`
26-
detail += `,账户乐星总数: ${res.data.result_rows.postStar}`
27-
} else if (res.data.result == 12130020) {
28-
subTitle += `,签到结果:成功 (重复签到)`
29-
} else {
30-
subTitle += `,签到结果: 失败`
31-
detail += `,编码: ${res.data.result}, 说明: ${res.data.res_info}`
32-
}
33-
senku.msg(cookieName, subTitle, detail)
34-
senku.done()
23+
senku.log(`${cookieName}, sing--data: ${data}`)
24+
signinfo.sign = JSON.parse(data)
3525
})
3626
}
3727

38-
function check(){
28+
function signDaily(){
3929
const url = { url: `https://pm.m.fenqile.com/route0014/app/tab/privilege/convertTaskReward.json`, headers: JSON.parse(signheaderVal), body: signBodyVal }
4030
senku.post(url, (error, response, data) => {
41-
senku.log(`${cookieName}, data: ${data}`)
42-
const res = JSON.parse(data)
43-
if (res.data.result == 0) {
44-
subTitle = `天天领乐星:成功`
45-
} else if (res.data.result == 11650011) {
46-
detail = `天天领乐星:重复`
31+
senku.log(`${cookieName}, signDaily--data: ${data}`)
32+
signinfo.signDaily = JSON.parse(data)
33+
})
34+
}
35+
36+
37+
function getinfo(){
38+
const title = `${cookieName}`
39+
let subTitle = `天天领乐星:`
40+
let detail = ``
41+
42+
//signDaily
43+
if (signinfo.signDaily.data.result == 0) {
44+
subTitle += `成功`
45+
}
46+
else if (signinfo.signDaily.data.result == 11650011) {
47+
subTitle += `重复签到`
48+
}
49+
else {
50+
subTitle += `失败`
51+
detail += `编码: ${signinfo.signDaily.data.result}, 说明: ${signinfo.signDaily.data.res_info}`
52+
}
53+
54+
//sign
55+
subTitle += ` 签到领乐星:`
56+
if (signinfo.sign.data.result == 0) {
57+
subTitle += `成功`
58+
detail += `账户乐星总数: ${signinfo.sign.data.result_rows.postStar}`
59+
}
60+
else if (signinfo.sign.data.result == 12130022) {
61+
subTitle += `重复签到`
62+
}
63+
else {
64+
subTitle += `失败`
65+
detail += `编码: ${signinfo.sign.data.result}, 说明: ${signinfo.sign.data.res_info}`
66+
}
67+
senku.msg(title, subTitle, detail)
68+
senku.done()
69+
}
70+
71+
function checkin(checkms = 0) {
72+
if (signinfo.sign && signinfo.signDaily) {
73+
getinfo()
74+
} else {
75+
if (checkms > 5000) {
76+
chavy.msg(`${cookieName}`, `签到失败: 超时退出`, ``)
77+
chavy.done()
4778
} else {
48-
subTitle = `天天领乐星:失败`
49-
detail = `编码: ${res.data.result}, 说明: ${res.data.res_info}`
79+
setTimeout(() => check(checkms + 100), 100)
5080
}
51-
senku.done()
52-
})
81+
}
5382
}
5483

5584
function init() {

0 commit comments

Comments
 (0)