Authored by 周少峰

old brands redirect

... ... @@ -19,7 +19,7 @@ router.get(/\/(boys|girls|kids|lifestyle)-brands(\/)?$/,
function(req, res, next) {
req.query.channel = req.params[0];
if (req.query.channel === 'kids') {
req.query.msort =365;
req.query.msort = 365;
}
next();
}, brandsController.index);
... ...
... ... @@ -4,7 +4,7 @@
'use strict';
const _ = require('lodash');
//const _ = require('lodash');
const helpers = global.yoho.helpers;
const TYPE = require('../type');
... ... @@ -32,26 +32,14 @@ module.exports = [
{
type: TYPE.redirect,
origin: '/brands?gender=1,3&channel=boys',
target: 'http://www.yohobuy.com/boys-brands/'
},
{
type: TYPE.redirect,
origin: '/brands?gender=2,3&channel=girls',
target: 'http://www.yohobuy.com/girls-brands/'
},
{
type: TYPE.redirect,
origin: '/brands?msort=365&channel=kids',
target: 'http://www.yohobuy.com/kids-brands/'
},
{
type: TYPE.redirect,
origin: '/brands?channel=lifestyle',
target: 'http://www.yohobuy.com/lifestyle-brands/'
origin: /\/brands\?.*channel=(boys|girls|kids|lifestyle)/,
target: (req) => {
return helpers.urlFormat(
`/${req.query.channel}-brands/`,
null,
'www'
);
}
},
{
... ...