调整日志
This commit is contained in:
+3
-3
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user