From d2288632db2088e5c7adbf665fef5532c7dd67f7 Mon Sep 17 00:00:00 2001 From: billow <2528273456@qq.com> Date: Sun, 31 Mar 2024 23:05:12 +0800 Subject: [PATCH] fix: pre filter middleware not working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 pre filter 中间件不生效 --- server/internal/logic/middleware/pre_filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/internal/logic/middleware/pre_filter.go b/server/internal/logic/middleware/pre_filter.go index ef56649..2f8e42d 100644 --- a/server/internal/logic/middleware/pre_filter.go +++ b/server/internal/logic/middleware/pre_filter.go @@ -59,7 +59,7 @@ func (s *sMiddleware) GenRouteKey(method, path string) string { // PreFilter 请求输入预处理 // api使用gf规范路由并且XxxReq结构体实现了validate.Filter接口即可 func (s *sMiddleware) PreFilter(r *ghttp.Request) { - router, ok := s.GetFilterRoutes(r)[s.GenFilterRouteKey(r.Router)] + router, ok := s.GetFilterRoutes(r)[s.GenFilterRequestKey(r)] if !ok { r.Middleware.Next() return