优化架构,新增路由

This commit is contained in:
robin
2022-06-04 11:43:05 +08:00
parent ba9ca43729
commit 264ab8d979
22 changed files with 161 additions and 60 deletions
+16
View File
@@ -0,0 +1,16 @@
module.exports = {
success: (body, msg, status) => {
return {
res : body || null,
status: status || 200,
message : msg || "success"
}
},
error : (body, msg, status) => {
return {
res : body || null,
status: status || 400,
message : msg || "error"
}
}
}
+2
View File
@@ -0,0 +1,2 @@
module.exports = {
}
+9
View File
@@ -0,0 +1,9 @@
/**
* 封装api返回结果
*/
const config = require("./config")
const body = require("./body")
module.exports = async (app) => {
app.res = body
}