|
@@ -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
|
// 上报服务端错误
|