优化架构,新增路由
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
const error = require('koa-json-error')
|
||||
// 错误处理
|
||||
module.exports = {
|
||||
sort: 3, //排序
|
||||
use : true, // 是否使用
|
||||
fun : 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
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user