소스 검색

fix:验证码发送限制

zqbao 7 달 전
부모
커밋
5c115d6ce8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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
 		}