Skip to content

Commit

Permalink
fix: 展示信息
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Jan 15, 2025
1 parent 084e800 commit 27ffc94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 9 additions & 3 deletions bypasscf.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,18 @@ async function login(page, username, password, retryCount = 3) {
const alertError = await page.$(".alert.alert-error");
if (alertError) {
const alertText = await page.evaluate((el) => el.innerText, alertError); // 使用 evaluate 获取 innerText
if (alertText.includes("incorrect") || alertText.includes("不正确")) {
if (
alertText.includes("incorrect") ||
alertText.includes("Incorrect ") ||
alertText.includes("不正确")
) {
throw new Error(
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 密码 ${password}, 错误信息:${alertText}`
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 错误信息:${alertText}`
);
} else {
console.log("非超时错误,也不是密码错误,错误信息:", alertText);
throw new Error(
`非超时错误,也不是密码错误,失败用户 ${username},错误信息:${alertText}`
);
}
} else {
if (retryCount > 0) {
Expand Down
12 changes: 9 additions & 3 deletions bypasscf_likeUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,18 @@ async function login(page, username, password, retryCount = 3) {
const alertError = await page.$(".alert.alert-error");
if (alertError) {
const alertText = await page.evaluate((el) => el.innerText, alertError); // 使用 evaluate 获取 innerText
if (alertText.includes("incorrect") || alertText.includes("不正确")) {
if (
alertText.includes("incorrect") ||
alertText.includes("Incorrect ") ||
alertText.includes("不正确")
) {
throw new Error(
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 密码 ${password}, 错误信息:${alertText}`
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 错误信息:${alertText}`
);
} else {
console.log("非超时错误,也不是密码错误,错误信息:", alertText);
throw new Error(
`非超时错误,也不是密码错误,失败用户 ${username},错误信息:${alertText}`
);
}
} else {
if (retryCount > 0) {
Expand Down

0 comments on commit 27ffc94

Please sign in to comment.