Authored by 毕凯

Merge branch 'hotfix/someerror' into 'release/5.5.1'

线上报错日志处理



See merge request !446
... ... @@ -3,7 +3,7 @@
* @Author: Targaryen
* @Date: 2017-01-04 15:17:51
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-20 14:03:48
* @Last Modified time: 2017-03-31 17:25:34
*/
'use strict';
... ... @@ -29,7 +29,7 @@ const payCenter = (req, res, next) => {
let orderCode = req.query.order_code;
let uid = req.user.uid;
let sessionKey = req.session.TOKEN;
let userAgent = req.get('User-Agent');
let userAgent = req.get('User-Agent') || '';
let hasWxShare = Boolean(userAgent.match(/MicroMessenger/i) && userAgent.match(/MicroMessenger/i).length > 0);
if (!orderCode || !uid) {
... ...
... ... @@ -99,7 +99,7 @@ const getPageData = (gender, sortId, uid, udid, page, tag, authorId, isApp, show
return getArticleList(gender, sortId, uid, udid, page, tag, authorId).then(article => {
let result = {};
if (!article.data.list.artList) {
if (!_.get(article, 'data.list.artList', false)) {
return result;
}
... ...
... ... @@ -27,8 +27,8 @@ exports.getUser = (req, res, next) => {
};
detailModel.getUserProfile(uid).then((data) => {
result.isStudent = data.data && data.data.vip_info && data.data.vip_info.is_student ? true : false;
result.vipLevel = (data.data && data.data.vip_info && data.data.vip_info.cur_level) || '0';
result.isStudent = _.get(data, 'data.vip_info.is_student', false);
result.vipLevel = _.get(data, 'data.vip_info.cur_level', '0');
req.__User__ = result;
next();
}).catch(next);
... ...