diff --git a/app/http/middlewares/base.go b/app/http/middlewares/base.go index 14b50b5..bafa004 100644 --- a/app/http/middlewares/base.go +++ b/app/http/middlewares/base.go @@ -68,12 +68,13 @@ func ValidateRequest() gin.HandlerFunc { utils.Log(c, "path", path) controllers.HandCodeRes(c, nil, errorcode.NotFound) } else { - msg, err := controllers.GenRequest(c, handler()) + v := handler() + msg, err := controllers.GenRequest(c, v) if err != nil { utils.Log(c, "path", path) controllers.Error(c, errorcode.ParamError, msg...) } else { - c.Set("request", handler()) + c.Set("request", v) c.Next() }