Authored by htoooth

fix bug

... ... @@ -4,6 +4,8 @@
* @date: 2016/6/16
*/
'use strict';
const _ = require('lodash');
const qs = require('querystring');
module.exports = () => {
return (req, res, next) => {
... ... @@ -67,11 +69,19 @@ module.exports = () => {
}
default: // 其它(识别为品牌)
{ // eslint-disable-line
let queryString = (function() {
if (!_.isEmpty(req.query)) {
return '&' + qs.stringify(req.query);
} else {
return '';
}
}());
req.query.domain = req.subdomains[0];
if (!req.path || req.path === '/') {
req.url = `/product/index/brand?domain=${req.subdomains[0]}`;
req.url = `/product/index/brand?domain=${req.subdomains[0]}${queryString}`;
} else if (req.path === '/about') {
req.url = `/product/index/about?domain=${req.subdomains[0]}`;
req.url = `/product/index/brand?domain=${req.subdomains[0]}${queryString}`;
}
break;
}
... ...