Browse Source

fix:验证码次数限制

zqbao 7 months ago
parent
commit
6368fa64e0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      controllers/user.go

+ 2 - 2
controllers/user.go

@@ -224,7 +224,7 @@ func (this *UserController) GetVerifyCode() {
 		}
 		phoneKey := utils.CACHE_ACCESS_PHONE_LOGIN_CODE + req.AreaCode + req.Phone
 		res, _ := go_redis.RedisInt(phoneKey)
-		if res > 5 {
+		if res >= 5 {
 			br.Msg = "验证码发送太频繁,请稍后重试"
 			return
 		}
@@ -284,7 +284,7 @@ func (this *UserController) GetVerifyCode() {
 
 		emailKey := utils.CACHE_ACCESS_EMAIL_LOGIN_CODE + req.Email
 		res, _ := go_redis.RedisInt(emailKey)
-		if res > 5 {
+		if res >= 5 {
 			br.Msg = "验证码发送太频繁,请稍后重试"
 			return
 		}