优化架构,新增路由
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user