Authored by htoooth

change router

... ... @@ -39,7 +39,7 @@ const helpers = global.yoho.helpers;
helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90'));
// NOTE:这里修改了参数的个数
helpers.getUrlBySkc = pid => `//item.yohobuy.com/product_${pid}.html`;
helpers.getUrlBySkc = pid => `//item.yohobuy.com/p_${pid}.html`;
global.middleware = path.resolve('./doraemon/middleware');
global.utils = path.resolve('./utils');
... ...
... ... @@ -63,7 +63,7 @@ router.get('/outlets/:channel', outlets.channel); // 奥莱频道页
// 商品分类列表页
router.get('/list', outletsList.index);
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.redirectNewProduct);
router.get(/\/product_([\d]+)(.*)/, detail.showMain); // 商品详情routers
router.get(/\/p_([\d]+)(.*)/, detail.showMain); // 商品详情routers
router.get('/detail/comment', detail.indexComment); // 商品评论
router.get('/detail/consult', detail.indexConsult); // 商品咨询
router.post('/detail/consult', auth, detail.createConsult); // 创建咨询
... ...
... ... @@ -22,8 +22,8 @@ module.exports = () => {
case 'new': // 原新版
case 'shop': // 商家入驻
case 'item':// 商品详情页
if (/\/product_([\d]+)(.*)/.exec(req.url) !== null) {
req.url = `/product/product_${RegExp.$1}${RegExp.$2}`;
if (/\/p_([\d]+)(.*)/.exec(req.url) !== null) {
req.url = `/product/p_${RegExp.$1}${RegExp.$2}`;
}
break;
case 'guang': // 逛
... ...