删除了ai识别验证码部分,新增个人成绩补考标识和cet成绩查询
Some checks failed
Build / build (push) Failing after 2m13s

This commit is contained in:
WuYuuuub
2026-06-17 14:48:27 +08:00
parent c4c3320f51
commit 4024f9eae0
9 changed files with 110 additions and 79 deletions

View File

@@ -78,6 +78,7 @@ func convertGrades(grades []models.GradeEntry) []*pb.Grade {
Score: g.Score,
GradePoint: g.GradePoint,
IsExam: g.IsExam,
IsRetake: g.IsRetake,
})
}
return result

View File

@@ -58,7 +58,7 @@ func (s *Service) setTWFIDCookie(httpClient *http.Client, baseURL, twfid string)
})
}
// login 执行登录流程,包含验证码识别与重试
// login 执行登录流程,验证码固定使用占位值 "...."
func (s *Service) login(ctx context.Context, httpClient *http.Client, username, password string) error {
log := slog.With("username", username)
@@ -75,13 +75,7 @@ func (s *Service) login(ctx context.Context, httpClient *http.Client, username,
log.Info("尝试登录", "attempt", attempt, "max_retries", maxLoginRetries)
captchaCode, err := captcha.GetAndRecognize(httpClient)
if err != nil {
log.Warn("验证码获取失败", "error", err, "attempt", attempt)
time.Sleep(loginRetryInterval)
continue
}
captchaCode := captcha.GetCaptchaCode()
success, err := auth.LoginWithClient(ctx, httpClient, captchaCode, username, password)
if err != nil {
log.Warn("登录请求失败", "error", err, "attempt", attempt)