优化架构,新增路由

This commit is contained in:
robin committed 2022-07-09 02:54:00 +08:00
1 parent a9a4bd0981
commit 73c1343060
8 files changed
+3 -30

No files matched your search

+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) {