This commit is contained in:
robin
2022-07-07 22:16:39 +08:00
parent 264ab8d979
commit a9a4bd0981
86 changed files with 1198 additions and 310 deletions
+20
View File
@@ -0,0 +1,20 @@
'use strict';
module.exports = {
// path : "cms/api/index",//可以覆盖自动生成的路由地址
params: {
"age": "int?"
},
fun : async (ctx, app) => {
const body = ctx.params
const User = await app.db.table("User").find()
//成功返回的2种方式
// ctx.body = app.res.success(User,"success",200)//"success",200可以省略
return User
//异常返回的2种方式
// ctx.body = app.res.error(User, "error", 400)//"error",400可以省略
// return false
}
}