Browse Source

fix:验证码发送限制

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

+ 2 - 2
controllers/user.go

@@ -231,7 +231,7 @@ func (this *UserController) GetVerifyCode() {
 
 		phoneCountKey := utils.CACHE_ACCESS_PHONE_COUNT_LOGIN_CODE + req.AreaCode + req.Phone
 		resCount, _ := go_redis.RedisInt(phoneCountKey)
-		if resCount > utils.VerifyCodeSendLimit {
+		if resCount >= utils.VerifyCodeSendLimit {
 			br.Msg = fmt.Sprintf("一天最多获取%s次,已超限", strconv.Itoa(utils.VerifyCodeSendLimit))
 			return
 		}
@@ -290,7 +290,7 @@ func (this *UserController) GetVerifyCode() {
 		}
 		emailCountKey := utils.CACHE_ACCESS_EMAIL_COUNT_LOGIN_CODE + req.Email
 		resCount, _ := go_redis.RedisInt(emailCountKey)
-		if resCount > utils.VerifyCodeSendLimit {
+		if resCount >= utils.VerifyCodeSendLimit {
 			br.Msg = fmt.Sprintf("一天最多获取%s次,已超限", strconv.Itoa(utils.VerifyCodeSendLimit))
 			return
 		}