Skip to content

Commit c6de5b8

Browse files
committed
修复[百度知道|v2ex|威锋网]在IOS12下报错问题
1 parent 9a47cca commit c6de5b8

4 files changed

Lines changed: 4 additions & 10 deletions

File tree

‎feng/feng.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function showSurgeMsg(signResult) {
8282
}
8383

8484
function getToken() {
85-
const userInfo = decodeURIComponent(decodeURIComponent([...cookieVal.matchAll(/userInfo=(\{[^;]*)/g)][0][1]))
85+
const userInfo = decodeURIComponent(decodeURIComponent(cookieVal.match(/userInfo=(\{[^;]*)/)[1]))
8686
return JSON.parse(userInfo).accessToken
8787
}
8888

‎tieba/tieba.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function signZhidao() {
8989
chavy.get(url, (error, response, data) => {
9090
const timestamp = Date.parse(new Date())
9191
const utdata = `61,61,7,0,0,0,12,61,5,2,12,4,24,5,4,1,4,${timestamp}`
92-
const stoken = [...data.matchAll(/"stoken"[^"]*"([^"]*)"/g)][0][1]
92+
const stoken = data.match(/"stoken"[^"]*"([^"]*)"/)[1]
9393
const signurl = { url: `https://zhidao.baidu.com/submit/user`, headers: { Cookie: cookieVal }, body: {} }
9494
signurl.body = `cm=100509&utdata=${utdata}&stoken=${stoken}`
9595
chavy.post(signurl, (signerror, signresp, signdata) => {

‎v2ex/quanx/v2ex.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ function sign() {
1919
console.log(`${title}, ${subTitle}, ${detail}`)
2020
$notify(title, subTitle, detail)
2121
} else {
22-
let regex = /<input[^>]*\/mission\/daily\/redeem\?once=(\d+)[^>]*>/g
23-
for (const code of data.matchAll(regex)) {
24-
signMission(code[1])
25-
}
22+
signMission(data.match(/<input[^>]*\/mission\/daily\/redeem\?once=(\d+)[^>]*>/)[1])
2623
}
2724
})
2825
}

‎v2ex/v2ex.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ function sign() {
1717
console.log(`${title}, ${subTitle}, ${detail}`)
1818
$notification.post(title, subTitle, detail)
1919
} else {
20-
let regex = /<input[^>]*\/mission\/daily\/redeem\?once=(\d+)[^>]*>/g
21-
for (const code of data.matchAll(regex)) {
22-
signMission(code[1])
23-
}
20+
signMission(data.match(/<input[^>]*\/mission\/daily\/redeem\?once=(\d+)[^>]*>/)[1])
2421
}
2522
})
2623
$done({})

0 commit comments

Comments
 (0)