Authored by 李奇

Merge branch 'master' into feature/pressure-test

... ... @@ -139,9 +139,10 @@ const redpac = {
return res.json(result || {});
}).catch(e => {
console.log('error:', e);
console.log('MyError:', e);
sendMessage(0, {}, {message: e.message || 'interface error', stack: e}, 1);
next();
next(e);
});
},
... ...
... ... @@ -41,7 +41,7 @@ const sendMessage = (type, tags, fields, isFail) => {
fields
});
} catch (e) {
console.error(e);
logger.error(e);
}
};
... ... @@ -255,16 +255,19 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
}
});
sendMessage(0, {}, {succeedTimes: sendResult.data && sendResult.data.amount || 0}, 0);
sendResult = sendResult || {};
sendResult.data = sendResult.data || {};
sendMessage(0, {}, {succeedTimes: sendResult.data.amount || 0}, 0);
if (sendResult && sendResult.code === 200) {
if (sendResult.data.isRepReceive === 'N') {
sendResult.code = 201; // 不能重复领取
if (sendResult.code === 200) {
if (!sendResult.data.amount) {
sendResult.code = 201; // 重复领取
} else {
getPrize.desc = '恭喜您获得' + sendResult.data.amount + '元红包';
}
}
} catch (e) {
logger.error(e);
sendMessage(0, {}, {message: e.message || 'interface error', stack: e}, 1);
}
} else if (getPrize.type === 3) {
... ... @@ -284,6 +287,7 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
}
} catch (e) {
logger.error(e);
sendMessage(1, {}, {message: e.message || 'interface error', stack: e}, 1);
}
} else if (getPrize.type === 4) {
... ...
... ... @@ -9,7 +9,7 @@ const serverError = (err, req, res, next) => { // eslint-disable-line
logger.error(err);
let code = 500, msg = '服务器错误!';
if (err.code && typeof err.code === 'number' && err.code !== 500 && err.message && !err.message.match(/_ERROR/gi)[0]) {
if (err.code && typeof err.code === 'number' && err.code !== 500 && err.message && !/_ERROR/.test(err.message)) {
code = err.code;
msg = err.message;
}
... ...
This diff could not be displayed because it is too large.
... ... @@ -79,7 +79,7 @@
"uuid": "^3.1.0",
"whatwg-fetch": "^2.0.3",
"xlsx": "^0.11.16",
"xlsx-style":"^0.8.13",
"xlsx-style": "^0.8.13",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "^0.6.33",
"yoho-zookeeper": "^1.0.8"
... ...