Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(captcha): If no operation previously, it is considered to be the first operation.

LinkinStars2f8351bb8e86
diff --git a/internal/service/action/captcha_strategy.go b/internal/service/action/captcha_strategy.go
index 09555f87..4208773e 100644
--- a/internal/service/action/captcha_strategy.go
+++ b/internal/service/action/captcha_strategy.go
@@ -17,11 +17,9 @@ func (cs *CaptchaService) ValidationStrategy(ctx context.Context, unit, actionTy
log.Error(err)
return false
}
+ // If no operation previously, it is considered to be the first operation
if info == nil {
- info = &entity.ActionRecordInfo{
- LastTime: time.Now().Unix(),
- Num: 1,
- }
+ return true
}
switch actionType {
case entity.CaptchaActionEmail: