Skip to content

Commit

Permalink
Update cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
shenghui0779 committed Dec 7, 2024
1 parent 96df046 commit 0e7c9da
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/internal/http/pkg_lib_middleware_log.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit 0e7c9da

Please sign in to comment.