【发布时间】:2018-02-20 08:15:32
【问题描述】:
这就是我的想法,伪代码。
const myRedirect = (routePath) => {
newUrl = routePath;
if (matches condition)
newUrl = do_some_modification(routePath);
return next(newUrl);
}
const myFunc = (routePath, myRedirect) => (newUrl, middleware) => {
return (ctx, newUrl, next) => {
return middleware(ctx, newUrl, next);
}
};
请问如何修改它以使其正常工作?
【问题讨论】: