日志:添加没有paramDecode的接口的日志

This commit is contained in:
luying
2022-05-07 16:36:02 +08:00
parent 5122558f40
commit 91f04c291d

View File

@@ -35,7 +35,9 @@ module.exports = options => {
let url = ctx.request.url;
ctx.logcode = genCode(10);
if(url.indexOf("/dev") == 0 || url.indexOf("/web") == 0 || url.indexOf("/cb") == 0) {
ctx.service.utils.log('INFO', `[${ctx.request.url}] [${ctx.logcode}] request: ${JSON.stringify(ctx.request.body)}`);
await next();
ctx.service.utils.log('INFO', `[${ctx.request.url}] [${ctx.logcode}] res: ${JSON.stringify(ctx.body)}`)
return;
}
if (options.threshold && ctx.length < options.threshold) return;