Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
fix: redirect status code
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Mar 21, 2021
1 parent 43cf1a7 commit 5ef08ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crawler/casLogIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ module.exports = async (school, user) => {
console.error(e)
return
}
if (res.status === 302 && reCook(res, 0, cookie)) {
if (/30(1|2)/.test(res.status + '') && reCook(res, 0, cookie)) {
log.success(`用户${name}: 登录成功`)
} else {
log.error(`用户${name}:登录失败,${res.statusText}`)
return
}

Expand Down

0 comments on commit 5ef08ce

Please sign in to comment.