由买买提看人间百态

topics

全部话题 - 话题: routepath
(共0页)
s*****w
发帖数: 1527
1
有没有这样的写法?
pseudo code这么写,请大家看看应该怎么改正。
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);
}
};
(共0页)