Authored by 杨延青

Merge branch 'feature/seo-1120' into 'gray'

Feature/seo 1120

seo

See merge request !178
... ... @@ -123,7 +123,7 @@ module.exports = class extends global.yoho.BaseModel {
// isReco: articleData.is_recommended && Number(articleData.is_recommended) === 1 ? true : false,
url: +articleData.category_id === 9999 ?
helpers.urlFormat(`/${_.get(articleData, 'product_list[0].product_skn', 0)}.html`, null, 'item') :
helpers.getUrlBySkc(_.get(articleData, 'product_list[0].product_skn', 0)) :
ghelper.getArticleUrl(articleData.url, articleData.id),
img: helpers.image(articleData.src, width, height, 1),
isSquareImg: isSquareImage,
... ...
... ... @@ -1425,7 +1425,7 @@ exports.handleCheckedData = handleCheckedData;
exports.handleNextPage = (params, total) => {
let href;
let currentPage = parseInt((params.page ? params.page : 1), 10); // 当前页
let perPageCount = parseInt((params.limit ? params.limit : 60) - 1, 10); // 每页商品数
let perPageCount = parseInt((params.limit ? params.limit : 40) - 1, 10); // 每页商品数
let totalPage = _.ceil(total / perPageCount); // 总页数
if (currentPage >= totalPage) {
... ...
... ... @@ -39,11 +39,11 @@ module.exports = [
// 商品详情页新链接
{
type: TYPE.rewrite,
type: TYPE.redirect,
origin: /^\/([\d]+).html(.*)/,
target: (req, match, p1, p2) => {
req.mobileUrl = `${MOBILE_DOMAIN}/product/${p1}.html${p2 ? p2 : ''}`;
return `/product${req.url}`;
return helpers.urlFormat(`/product${req.url}`, null, 'www');
}
}
];
... ...