Authored by 李奇

优惠券领取成功逻辑和错误log添加

... ... @@ -41,7 +41,7 @@ const sendMessage = (type, tags, fields, isFail) => {
fields
});
} catch (e) {
console.error(e);
logger.error(e);
}
};
... ... @@ -247,13 +247,14 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
sendMessage(0, {}, {succeedTimes: sendResult.data && sendResult.data.amount || 0}, 0);
if (sendResult && sendResult.code === 200) {
if (sendResult.data.isRepReceive === 'N') {
sendResult.code = 201; // 不能重复领取
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) {
... ... @@ -273,6 +274,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) {
... ...