Authored by htoooth

update udid

@@ -8,6 +8,7 @@ const helpers = global.yoho.helpers; @@ -8,6 +8,7 @@ const helpers = global.yoho.helpers;
8 const sender = global.yoho.apmSender; 8 const sender = global.yoho.apmSender;
9 const hostname = require('os').hostname(); 9 const hostname = require('os').hostname();
10 const routeEncode = require('./route-encode'); 10 const routeEncode = require('./route-encode');
  11 +const _ = require('lodash');
11 12
12 const forceNoCache = (res) => { 13 const forceNoCache = (res) => {
13 if (res && !res.finished) { 14 if (res && !res.finished) {
@@ -53,7 +54,7 @@ exports.serverError = () => { @@ -53,7 +54,7 @@ exports.serverError = () => {
53 return (err, req, res, next) => { 54 return (err, req, res, next) => {
54 forceNoCache(res); 55 forceNoCache(res);
55 const uid = req.user ? req.user.uid : 0; 56 const uid = req.user ? req.user.uid : 0;
56 - const udid = req.query.udid || req.cookies ? req.cookies._yasvd : 0; 57 + const udid = _.get(req, 'cookies.udid', 0);
57 58
58 if (req.isApmReport) { 59 if (req.isApmReport) {
59 // 上报服务端错误 60 // 上报服务端错误
@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 "xml2js": "^0.4.19", 73 "xml2js": "^0.4.19",
74 "yoho-express-session": "^2.0.0", 74 "yoho-express-session": "^2.0.0",
75 "yoho-md5": "^2.0.0", 75 "yoho-md5": "^2.0.0",
76 - "yoho-node-lib": "=0.5.31", 76 + "yoho-node-lib": "=0.5.34",
77 "yoho-zookeeper": "^1.0.8" 77 "yoho-zookeeper": "^1.0.8"
78 }, 78 },
79 "devDependencies": { 79 "devDependencies": {