Prechádzať zdrojové kódy

更改短信获取次数

abiao 5 rokov pred
rodič
commit
d028fef8fd

+ 3 - 3
go/gopath/src/fohow.com/apps/controllers/sms_controller/sms_controller.go

@@ -74,9 +74,9 @@ func (self *SMSController) Send() {
 	if ipTimes, ok := cache.Cache.Get(ipKey).(int64); ok {
 		ipTimes = ipTimes + 1
 		cache.Cache.Put(ipKey, ipTimes, 1*time.Minute)
-		if ipTimes > 2 {
-			//beego.BeeLogger.Error("sms send too often!!! IP: %s, tel:%s, msg_type: %s, times: %d", ip, tel, msg_type, ipTimes)
-			//self.ReturnError(403, apps.CodesSendTooOften, "", nil)
+		if ipTimes > 10 {
+			beego.BeeLogger.Error("sms send too often!!! IP: %s, tel:%s, msg_type: %s, times: %d", ip, tel, msg_type, ipTimes)
+			self.ReturnError(403, apps.CodesSendTooOften, "", nil)
 		}
 	} else {
 		ipTimes = 1