Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed Nov 8, 2017
1 parent adba67e commit 54abaef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/loader/mixin/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ function wrapClass(Controller) {
return ret;

function methodToMiddleware(Controller, key) {
return async function classControllerMiddleware(...args) {
return function classControllerMiddleware(...args) {
const controller = new Controller(this);
if (!this.app.config.controller || !this.app.config.controller.supportParams) {
args = [ this ];
}
return await utils.callFn(controller[key], args, controller);
return utils.callFn(controller[key], args, controller);
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ function convertMiddlewares(middlewares, app) {
const controller = resolveController(middlewares.pop(), app);
// make middleware support generator function
middlewares = middlewares.map(utils.middleware);
const wrappedController = async (ctx, next) => {
return await utils.callFn(controller, [ ctx, next ], ctx);
const wrappedController = (ctx, next) => {
return utils.callFn(controller, [ ctx, next ], ctx);
};
return middlewares.concat([ wrappedController ]);
}
Expand Down

0 comments on commit 54abaef

Please sign in to comment.