Authored by 陈峰

Merge branch 'feature/wheel-surf' into 'release/6.7.9'

Feature/wheel surf



See merge request !68
@@ -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
@@ -244,16 +244,19 @@ class ActWheelSurfModel extends global.yoho.BaseModel { @@ -244,16 +244,19 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
244 } 244 }
245 }); 245 });
246 246
247 - sendMessage(0, {}, {succeedTimes: sendResult.data && sendResult.data.amount || 0}, 0); 247 + sendResult = sendResult || {};
  248 + sendResult.data = sendResult.data || {};
  249 + sendMessage(0, {}, {succeedTimes: sendResult.data.amount || 0}, 0);
248 250
249 - if (sendResult && sendResult.code === 200) {  
250 - if (sendResult.data.isRepReceive === 'N') {  
251 - sendResult.code = 201; // 不能重复领取 251 + if (sendResult.code === 200) {
  252 + if (!sendResult.data.amount) {
  253 + sendResult.code = 201; // 重复领取
252 } else { 254 } else {
253 getPrize.desc = '恭喜您获得' + sendResult.data.amount + '元红包'; 255 getPrize.desc = '恭喜您获得' + sendResult.data.amount + '元红包';
254 } 256 }
255 } 257 }
256 } catch (e) { 258 } catch (e) {
  259 + logger.error(e);
257 sendMessage(0, {}, {message: e.message || 'interface error', stack: e}, 1); 260 sendMessage(0, {}, {message: e.message || 'interface error', stack: e}, 1);
258 } 261 }
259 } else if (getPrize.type === 3) { 262 } else if (getPrize.type === 3) {
@@ -273,6 +276,7 @@ class ActWheelSurfModel extends global.yoho.BaseModel { @@ -273,6 +276,7 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
273 } 276 }
274 277
275 } catch (e) { 278 } catch (e) {
  279 + logger.error(e);
276 sendMessage(1, {}, {message: e.message || 'interface error', stack: e}, 1); 280 sendMessage(1, {}, {message: e.message || 'interface error', stack: e}, 1);
277 } 281 }
278 } else if (getPrize.type === 4) { 282 } else if (getPrize.type === 4) {