Authored by 毕凯

Merge branch 'hotfix/servererr' of git.yoho.cn:fe/yohobuywap-node into hotfix/servererr

... ... @@ -71,6 +71,14 @@ app.set('json replacer', function(key, value) {
return value;
});
app.use((req, res, next) => {
req.isApmReport = _.get(req.app.locals, 'wap.open.bughd', false); // 把错误上报的开关绑定到上下文,node-lib 库要使用
next();
});
// 添加请求上下文
app.use(global.yoho.httpCtx());
// 请求限制中间件
if (!app.locals.devEnv) {
app.use(require('./doraemon/middleware/limiter'));
... ... @@ -107,8 +115,6 @@ app.use((req, res, next) => {
req.yoho = {}; // req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等
req.app.locals.wap = app.locals.wap; // zookeper对象赋值
req.isApmReport = app.locals.wap.open && app.locals.wap.open.bughd; // 把错误上报的开关绑定到上下文,node-lib 库要使用
// 独立的 UDID
if (!req.cookies.udid) {
res.cookie('udid', uuid.v4(), {
... ...
... ... @@ -294,7 +294,7 @@ const category = (req, res, next) => {
* 品类落地页 SEO 友好的新路由
*/
const listNew = (req, res, next) => {
req.query = listParamsProcess.getParams(req.url);
req.query = listParamsProcess.getParams(req.path);
if (req.query) {
_.forEach(req.query, (perParam, index) => {
... ...
... ... @@ -73,7 +73,7 @@
"xml2js": "^0.4.19",
"yoho-express-session": "^2.0.0",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "=0.5.29",
"yoho-node-lib": "=0.5.31",
"yoho-zookeeper": "^1.0.8"
},
"devDependencies": {
... ...