Authored by 毕凯

Merge remote-tracking branch 'origin/feature/newSeo' into gray

... ... @@ -24,6 +24,15 @@ const channelToAppChannel = (channel) => {
}[channel] || '1';
};
const channelSeo = (channel) => {
return {
boys: '男生',
girls: '女生',
kids: '潮童',
lifestyle: '创意生活'
}[channel] || '男生';
};
// 新品到着(blk)
const blkNewGoods = (req, res, next) => {
let params = Object.assign({
... ... @@ -76,8 +85,9 @@ const newGoods = (req, res, next) => {
res.render('new/new', {
module: 'product',
page: 'new',
// title: '新品到着',
title: channelSeo(req.yoho.channel) + '新品上架,100%正品保证-YOHO!BUY 有货',
keywords: channelSeo(req.yoho.channel) + '新品,潮流新品,潮流正品',
description: channelSeo(req.yoho.channel) + '新品上架,正品网购,官方授权!100%品牌正品保证,支持货到付款。 想购买潮流商品就来YOHO! 有货中国最大的潮流商品购物网站。', // eslint-disable-line
pageHeader: headerModel.setNav({
navTitle: '新品到着'
}),
... ... @@ -104,7 +114,7 @@ const newGoodsRedirect = (req, res) => {
if (param) {
param = '?' + param;
}
res.redirect(301, `/product/${req.yoho.channel}-new/${param}`);
res.redirect(301, `/${req.yoho.channel}-new/${param}`);
};
/**
... ...
... ... @@ -77,6 +77,22 @@ module.exports = () => {
req.url = `/product/${req.url}`;
}
if (/^\/boy-new/.test(req.url)) {
req.url = '/product/boys-new/';
}
if (/^\/girls-new/.test(req.url)) {
req.url = '/product/girls-new/';
}
if (/^\/kids-new/.test(req.url)) {
req.url = '/product/kids-new/';
}
if (/^\/lifestyle-new/.test(req.url)) {
req.url = '/product/lifestyle-new/';
}
next();
};
};
... ...