优化架构,新增路由

This commit is contained in:
robin
2022-07-09 02:54:00 +08:00
parent a9a4bd0981
commit 73c1343060
8 changed files with 3 additions and 30 deletions
+1 -1
View File
@@ -15,7 +15,6 @@ module.exports = {
app.use(router.routes()).use(router.allowedMethods())
},
fun : async (app) => {
const parameter = app.parameter
const router = new Router({ //设置前缀
prefix: config.prefix
});
@@ -25,6 +24,7 @@ module.exports = {
console.log(url);
router.all(url, async (ctx, next) => {
await next();
const parameter = app.parameter
const validate = parameter.validate(item.res.params, ctx.params);
let res = null
if (validate) {