Authored by 郭成尧

list-router-add

/**
* URL 重写(主要用于兼容原来PHP的连接)
*/
const querystring = require('querystring');
const helpers = global.yoho.helpers;
module.exports = () => {
... ... @@ -71,6 +72,11 @@ module.exports = () => {
req.url = `/product/${req.url}`;
}
if (/^\/list/.test(req.url)) {
// 列表页路由重写 新路由
req.url = `/product/index/index?${querystring.stringify(req.query)}`;
}
next();
};
};
... ...