Browse Source

拦截

main
yaooort 3 years ago
parent
commit
52852e6ce2
  1. 1
      server/middleware/limit_ip.go

1
server/middleware/limit_ip.go

@ -18,6 +18,7 @@ func IPLimit() gin.HandlerFunc {
expiration := time.Duration(second) * time.Second expiration := time.Duration(second) * time.Second
if err := SetLimitWithTime(key, limit, expiration); err != nil { if err := SetLimitWithTime(key, limit, expiration); err != nil {
response.FailWithMessage(err.Error(), c) response.FailWithMessage(err.Error(), c)
c.Abort()
return return
} }
// 继续往下处理 // 继续往下处理

Loading…
Cancel
Save