up
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
const error = require('koa-json-error')
|
||||
// 错误处理
|
||||
module.exports = error((err) => {
|
||||
return {
|
||||
status : err.status,
|
||||
message : err.message,
|
||||
code : err.code,
|
||||
res : false,
|
||||
// postFormat: (e, obj) => process.env.NODE_ENV === 'production' ? _.omit(obj, 'stack') : obj
|
||||
}
|
||||
})
|
||||
@@ -5,7 +5,6 @@ module.exports = async (ctx, next, app) => {
|
||||
// const timetaken = `${ctx.request.method}${ctx.request.url} 响应时间`
|
||||
// console.time(timetaken)
|
||||
// app.logger.debug("123")
|
||||
throw new app.err.HttpException
|
||||
await next()
|
||||
// console.timeEnd(timetaken)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user