Authored by 周少峰

Merge branch 'master' into gray

@@ -25,6 +25,13 @@ const addTicket = co(function * (uid, sku, count, yohoCoin) { @@ -25,6 +25,13 @@ const addTicket = co(function * (uid, sku, count, yohoCoin) {
25 let ticketInfo = yield api.add(uid, sku, count, yohoCoin); 25 let ticketInfo = yield api.add(uid, sku, count, yohoCoin);
26 let result = {}; 26 let result = {};
27 27
  28 + if (_.isEmpty(ticketInfo)) {
  29 + return {
  30 + last_order_amount: 0,
  31 + error: '人太多啦,稍后再试!'
  32 + };
  33 + }
  34 +
28 if (ticketInfo.code !== 200) { 35 if (ticketInfo.code !== 200) {
29 return { 36 return {
30 last_order_amount: 0, 37 last_order_amount: 0,
@@ -43,6 +50,13 @@ const addTicket = co(function * (uid, sku, count, yohoCoin) { @@ -43,6 +50,13 @@ const addTicket = co(function * (uid, sku, count, yohoCoin) {
43 const submitTicket = co(function * (uid, sku, count, mobile, yohoCoin) { 50 const submitTicket = co(function * (uid, sku, count, mobile, yohoCoin) {
44 let result = yield api.submit(uid, sku, count, mobile, yohoCoin); 51 let result = yield api.submit(uid, sku, count, mobile, yohoCoin);
45 52
  53 + if (_.isEmpty(result)) {
  54 + return {
  55 + code: 500,
  56 + message: '人太多啦,稍后再试!'
  57 + };
  58 + }
  59 +
46 if (result.code !== 200) { 60 if (result.code !== 200) {
47 return { 61 return {
48 code: result.code, 62 code: result.code,