Authored by 郭成尧

new-router

@@ -13,7 +13,7 @@ const newModel = require(`${mRoot}/new`); @@ -13,7 +13,7 @@ const newModel = require(`${mRoot}/new`);
13 const searchModel = require(`${mRoot}/search`); 13 const searchModel = require(`${mRoot}/search`);
14 const _ = require('lodash'); 14 const _ = require('lodash');
15 const helpers = global.yoho.helpers; 15 const helpers = global.yoho.helpers;
16 -const qs = require('querystring'); 16 +const listParamsProcess = require(`${utils}/list-params-process`);
17 17
18 const channelToAppChannel = (channel) => { 18 const channelToAppChannel = (channel) => {
19 return { 19 return {
@@ -109,12 +109,10 @@ const newGoods = (req, res, next) => { @@ -109,12 +109,10 @@ const newGoods = (req, res, next) => {
109 109
110 // 301到新路由 110 // 301到新路由
111 const newGoodsRedirect = (req, res) => { 111 const newGoodsRedirect = (req, res) => {
112 - let param = qs.stringify(req.query); 112 + let pathParamsUrl = listParamsProcess.generatePathUrl(req.query, req.path);
  113 + let urlPath = _.replace(pathParamsUrl, '//m.yohobuy.com/new', `//m.yohobuy.com/${req.yoho.channel}-new`);
113 114
114 - if (param) {  
115 - param = '?' + param;  
116 - }  
117 - res.redirect(301, `/${req.yoho.channel}-new/${param}`); 115 + return res.redirect(301, urlPath);
118 }; 116 };
119 117
120 /** 118 /**