mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-09-18 01:06:40 +08:00
17 lines
411 B
Go
17 lines
411 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
"hotgo/internal/library/response"
|
|
"hotgo/internal/service"
|
|
)
|
|
|
|
// Blacklist IP黑名单限制中间件
|
|
func (s *sMiddleware) Blacklist(r *ghttp.Request) {
|
|
if err := service.SysBlacklist().VerifyRequest(r); err != nil {
|
|
response.JsonExit(r, gerror.Code(err).Code(), err.Error())
|
|
}
|
|
r.Middleware.Next()
|
|
}
|