From 0e7c9daa9e90d99e5ded24312916ed8eb2e5b7a4 Mon Sep 17 00:00:00 2001 From: shenghui Date: Sat, 7 Dec 2024 21:05:55 +0800 Subject: [PATCH] Update cmd --- cmd/internal/http/pkg_lib_middleware_log.tmpl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/internal/http/pkg_lib_middleware_log.tmpl b/cmd/internal/http/pkg_lib_middleware_log.tmpl index 1acd8a7..98d0059 100644 --- a/cmd/internal/http/pkg_lib_middleware_log.tmpl +++ b/cmd/internal/http/pkg_lib_middleware_log.tmpl @@ -16,8 +16,6 @@ import ( "{{.Module}}/pkg/lib/result" ) -const ContentJSON = "application/json" - // Log 日志中间件 func Log(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -41,7 +39,7 @@ func Log(next http.Handler) http.Handler { } } body = r.Form.Encode() - case ContentJSON: + case yiigo.ContentJSON: b, err := io.ReadAll(r.Body) // 取出Body if err != nil { result.ErrSystem(result.E(errors.WithMessage(err, "请求Body读取失败"))).JSON(w, r)