Authored by 李奇

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

@@ -41,7 +41,7 @@ const sendMessage = (type, tags, fields, isFail) => { @@ -41,7 +41,7 @@ const sendMessage = (type, tags, fields, isFail) => {
41 fields 41 fields
42 }); 42 });
43 } catch (e) { 43 } catch (e) {
44 - console.error(e); 44 + logger.error(e);
45 } 45 }
46 }; 46 };
47 47
@@ -247,13 +247,14 @@ class ActWheelSurfModel extends global.yoho.BaseModel { @@ -247,13 +247,14 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
247 sendMessage(0, {}, {succeedTimes: sendResult.data && sendResult.data.amount || 0}, 0); 247 sendMessage(0, {}, {succeedTimes: sendResult.data && sendResult.data.amount || 0}, 0);
248 248
249 if (sendResult && sendResult.code === 200) { 249 if (sendResult && sendResult.code === 200) {
250 - if (sendResult.data.isRepReceive === 'N') {  
251 - sendResult.code = 201; // 不能重复领取 250 + if (!sendResult.data.amount) {
  251 + sendResult.code = 201; // 重复领取
252 } else { 252 } else {
253 getPrize.desc = '恭喜您获得' + sendResult.data.amount + '元红包'; 253 getPrize.desc = '恭喜您获得' + sendResult.data.amount + '元红包';
254 } 254 }
255 } 255 }
256 } catch (e) { 256 } catch (e) {
  257 + logger.error(e);
257 sendMessage(0, {}, {message: e.message || 'interface error', stack: e}, 1); 258 sendMessage(0, {}, {message: e.message || 'interface error', stack: e}, 1);
258 } 259 }
259 } else if (getPrize.type === 3) { 260 } else if (getPrize.type === 3) {
@@ -273,6 +274,7 @@ class ActWheelSurfModel extends global.yoho.BaseModel { @@ -273,6 +274,7 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
273 } 274 }
274 275
275 } catch (e) { 276 } catch (e) {
  277 + logger.error(e);
276 sendMessage(1, {}, {message: e.message || 'interface error', stack: e}, 1); 278 sendMessage(1, {}, {message: e.message || 'interface error', stack: e}, 1);
277 } 279 }
278 } else if (getPrize.type === 4) { 280 } else if (getPrize.type === 4) {