Skip to content

Commit

Permalink
fix: error
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Jan 12, 2025
1 parent e689db0 commit a106c34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bypasscf.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,14 @@ async function login(page, username, password, retryCount = 3) {
]); //注意如果登录失败,这里会一直等待跳转,导致脚本执行失败 这点四个月之前你就发现了结果今天又遇到(有个用户遇到了https://linux.do/t/topic/169209/82),但是你没有在这个报错你提示我8.5
} catch (error) {
const alertError = await page.locator(".alert.alert-error");
if ((await alertError.isVisible()) > 0) {
if (alertError) {
const alertText = await alertError.innerText();
if (alertText.includes("incorrect") || alertText.includes("不正确")) {
throw new Error(
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 密码 ${password}, 错误信息:${alertText}`
);
} else {
console.log("非超时错误,也不是密码错误,错误信息:", alertText);
}
} else {
if (retryCount > 0) {
Expand Down
4 changes: 3 additions & 1 deletion bypasscf_likeUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,14 @@ async function login(page, username, password, retryCount = 3) {
]); //注意如果登录失败,这里会一直等待跳转,导致脚本执行失败 这点四个月之前你就发现了结果今天又遇到(有个用户遇到了https://linux.do/t/topic/169209/82),但是你没有在这个报错你提示我8.5
} catch (error) {
const alertError = await page.locator(".alert.alert-error");
if ((await alertError.isVisible()) > 0) {
if (alertError) {
const alertText = await alertError.innerText();
if (alertText.includes("incorrect") || alertText.includes("不正确")) {
throw new Error(
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 密码 ${password}, 错误信息:${alertText}`
);
} else {
console.log("非超时错误,也不是密码错误,错误信息:", alertText);
}
} else {
if (retryCount > 0) {
Expand Down

0 comments on commit a106c34

Please sign in to comment.