Authored by 陈峰

优化seo 参数

... ... @@ -10,6 +10,7 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model
const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab
const indexModel = require('../models/brand');
const typeLib = require('../../../config/type-lib');
const qs = require('querystring');
/**
* 品牌一览
... ... @@ -51,7 +52,12 @@ let index = (req, res, next) => {
// 301到新路由
let indexRedirect = (req, res) => {
res.redirect(`/${req.yoho.channel}-brands/`);
let param = qs.stringify(req.query);
if (param) {
param = '?' + param;
}
res.redirect(`/${req.yoho.channel}-brands/${param}`);
};
let brandList = (req, res, next) => {
... ...
... ... @@ -87,7 +87,12 @@ exports.index = (req, res, next) => {
// 301到新路由
exports.indexRedirect = (req, res) => {
res.redirect(`/guang/${req.yoho.channel}-plusstar/?${qs.stringify(req.query)}`);
let param = qs.stringify(req.query);
if (param) {
param = '?' + param;
}
res.redirect(`/guang/${req.yoho.channel}-plusstar/${param}`);
};
exports.userSkn = (req, res, next) => {
... ...
... ... @@ -13,7 +13,7 @@ const newModel = require(`${mRoot}/new`);
const searchModel = require(`${mRoot}/search`);
const _ = require('lodash');
const helpers = global.yoho.helpers;
const typeLib = require('../../../config/type-lib');
const qs = require('querystring');
// 新品到着(blk)
const blkNewGoods = (req, res, next) => {
... ... @@ -81,7 +81,12 @@ const newGoods = (req, res, next) => {
// 301到新路由
const newGoodsRedirect = (req, res) => {
res.redirect(`/product/${req.yoho.channel}-new/`);
let param = qs.stringify(req.query);
if (param) {
param = '?' + param;
}
res.redirect(`/product/${req.yoho.channel}-new/${param}`);
};
/**
... ...
... ... @@ -10,7 +10,7 @@ const mRoot = '../models';
// const cookie = require(`${library}/cookie`);
const headerModel = require('../../../doraemon/models/header');
const saleModel = require(`${mRoot}/sale`);
const typeLib = require('../../../config/type-lib');
const qs = require('querystring');
// const queryParam = {
// brand: '0',
... ... @@ -101,7 +101,12 @@ let index = (req, res, next) => {
// 301到新路由
let indexRedirect = (req, res) => {
res.redirect(`/product/${req.yoho.channel}-sale/`);
let param = qs.stringify(req.query);
if (param) {
param = '?' + param;
}
res.redirect(`/product/${req.yoho.channel}-sale/${param}`);
};
/**
... ...