Authored by 徐祁xuqi

Merge branch 'hotfix/product-name'

... ... @@ -81,6 +81,7 @@ const logger = global.yoho.logger;
// dispatcher
try {
const itemNameHandler = require('./doraemon/middleware/item-name-handler');
const mobileCheck = require('./doraemon/middleware/mobile-check');
const user = require('./doraemon/middleware/user');
const seo = require('./doraemon/middleware/seo');
... ... @@ -89,6 +90,8 @@ try {
const setPageInfo = require('./doraemon/middleware/set-pageinfo');
// YOHO 前置中间件
app.use(itemNameHandler);
app.use(mobileCheck());
app.use(setYohoData());
app.use(user());
... ...
/**
* 商品详情页部分商品名称重置,防止express内部decodeURIComponent不能解析url出错
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/8/23
*/
module.exports = function(req, res, next) {
if (/^\/product\/pro_/.test(req.url)) {
req.url = req.url.replace(/\/pro_([\d]+)_([\d]+)\/(.*)/, '/pro_$1_$2/yoho-replace.html');
}
next();
};
... ...