Authored by htoooth

add doc

... ... @@ -62,7 +62,6 @@ router.get('/outlets/:channel', outlets.channel); // 奥莱频道页
// 商品分类列表页
router.get('/list', outletsList.index);
router.get(/\/pro_([\d]+)_([\d]+)\/(.*).html(.*)/, detail.redirectNewRouter); // 老的商品详情routers
router.get(/\/p([\d]+)(.*)/, detail.showMain); // 新的商品详情routers
router.get('/detail/comment', detail.indexComment); // 商品评论
router.get('/detail/consult', detail.indexConsult); // 商品咨询
... ...
... ... @@ -24,6 +24,7 @@ files.forEach((file) => {
/**
* 1. origin 可接受是 正则 和 函数
* 2. target 可接受是 匹配字符串 和 函数
* 3. 301 是跳转 ;rewrite 改写 url
* @returns {Function}
*/
module.exports = () => {
... ...
... ... @@ -7,12 +7,15 @@
const helpers = global.yoho.helpers;
module.exports = [
{ // 商品详情页老链接
// 商品详情页老链接
{
type: '301',
origin: /^\/product\/pro_([\d]+)_([\d]+)\/(.*).html(.*)/,
target: (req, match, p1, p2, p3, p4) => helpers.urlFormat(`/p${p1}.html${p4}`, null, 'item')
},
{ // 商品详情页新链接
// 商品详情页新链接
{
type: '301',
origin: /\/p([\d]+)(.*)/,
target: req => helpers.urlFormat(req.url, null, 'item')
... ...
... ... @@ -20,7 +20,7 @@ module.exports = () => {
case 'www': // 主站
case 'cdnsrcwww': // 主站的回源地址
case 'shop': // 商家入驻
case 'new': // 原新版 重定向到301
case 'new':
case 'item':// 商品详情页
break;
case 'guang': // 逛
... ...