1 Commits

Author SHA1 Message Date
yun d3786198df 调整日志 2025-12-07 12:07:21 +08:00
+3 -3
View File
@@ -129,13 +129,13 @@ func ResponseCtx(ctx context.Context, w http.ResponseWriter, ops ...Option) {
} }
} }
bs, _ := json.Marshal(resp)
if !def.ignoreLog { if !def.ignoreLog {
// 记录日志 // 记录日志
def.logger.Info(ctx, "response:", resp) def.logger.Info(ctx, "response:", string(bs))
} }
bs, _ := json.Marshal(resp)
w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(200) w.WriteHeader(200)
n, err := w.Write(bs) n, err := w.Write(bs)