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

This commit is contained in:
LinkinStars 2023-08-23 17:43:43 +08:00
parent a00c781295
commit 2f8351bb8e
1 changed files with 2 additions and 4 deletions

View File

@ -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: