From 1f54583074ab4faab7581ebb1acdc6c8b6687569 Mon Sep 17 00:00:00 2001 From: htoooth <ht.anglenx@gmail.com> Date: Fri, 8 Dec 2017 18:35:16 +0800 Subject: [PATCH] fix --- app.js | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 9dd091a..596ca2a 100644 --- a/app.js +++ b/app.js @@ -61,6 +61,11 @@ app.enable('trust proxy'); app.set('subdomain offset', 2); +app.use((req, res, next) => { + req.isApmReport = _.get(req.app.locals, 'pc.open.bughd', false); + next(); +}); + // 添加请求上下文 app.use(global.yoho.httpCtx()); @@ -86,7 +91,6 @@ require('./doraemon/middleware/yoho-session')(app); app.use((req, res, next) => { req.user = {}; // 全局的用户数据 req.yoho = {}; // req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等 - req.isApmReport = _.get(req.app.locals, 'pc.open.bughd', false); if (!req.session) { req.session = {}; diff --git a/package.json b/package.json index 2543b3d..5a8bf49 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "urlencode": "^1.1.0", "uuid": "^2.0.2", "yoho-express-session": "^2.0.0", - "yoho-node-lib": "=0.5.29", + "yoho-node-lib": "=0.5.30", "yoho-zookeeper": "^1.0.8" }, "devDependencies": { -- libgit2 0.24.0