Authored by ccbikai(👎🏻🍜)

Merge branch 'release/newSearch'

@@ -95,12 +95,12 @@ const _getShopDecorator = (shopId) => { @@ -95,12 +95,12 @@ const _getShopDecorator = (shopId) => {
95 method: 'app.shopsdecorator.getList', 95 method: 'app.shopsdecorator.getList',
96 shop_id: shopId 96 shop_id: shopId
97 }, { 97 }, {
98 - cache: true 98 + cache: true,
  99 + code: 200
99 }).then((result) => { 100 }).then((result) => {
100 - if (result && result.code === 200) { 101 + if (result.data) {
101 return camelCase(result.data); 102 return camelCase(result.data);
102 } else { 103 } else {
103 - logger.error('get shop all resources api return code is not 200');  
104 return ''; 104 return '';
105 } 105 }
106 }); 106 });
@@ -117,11 +117,10 @@ const _getShopInfo = (shopId, uid) => { @@ -117,11 +117,10 @@ const _getShopInfo = (shopId, uid) => {
117 method: 'app.shops.getIntro', 117 method: 'app.shops.getIntro',
118 shop_id: shopId, 118 shop_id: shopId,
119 uid: uid || 0 119 uid: uid || 0
120 - }).then((result) => {  
121 - if (result && result.code === 200) { 120 + }, {code: 200}).then((result) => {
  121 + if (result.data) {
122 return camelCase(result.data); 122 return camelCase(result.data);
123 } else { 123 } else {
124 - logger.error('get shop info api return code is not 200');  
125 return {}; 124 return {};
126 } 125 }
127 }); 126 });
@@ -139,11 +138,10 @@ const _getShopCategory = (shopId, channel, gender) => { @@ -139,11 +138,10 @@ const _getShopCategory = (shopId, channel, gender) => {
139 yh_channel: yhChannel[channel], 138 yh_channel: yhChannel[channel],
140 gender: gender || '1,3', 139 gender: gender || '1,3',
141 shop_id: shopId 140 shop_id: shopId
142 - }).then(result => { 141 + }, {code: 200}).then(result => {
143 if (result && result.code === 200) { 142 if (result && result.code === 200) {
144 return camelCase(result.data); 143 return camelCase(result.data);
145 } else { 144 } else {
146 - logger.error('get shop all classify api return code is not 200');  
147 return {}; 145 return {};
148 } 146 }
149 }); 147 });
@@ -163,7 +161,7 @@ const _shopCouponsList = (shopId, uid) => { @@ -163,7 +161,7 @@ const _shopCouponsList = (shopId, uid) => {
163 _.assign(params, {uid: uid}); 161 _.assign(params, {uid: uid});
164 } 162 }
165 163
166 - return api.get('', params).then(result => { 164 + return api.get('', params, {code: 200}).then(result => {
167 if (result.data) { 165 if (result.data) {
168 let shopCoupons = []; 166 let shopCoupons = [];
169 167
@@ -200,7 +198,7 @@ const receiveCoupon = (uid, couponId) => { @@ -200,7 +198,7 @@ const receiveCoupon = (uid, couponId) => {
200 method: 'app.promotion.getCoupon', 198 method: 'app.promotion.getCoupon',
201 couponId: couponId, 199 couponId: couponId,
202 uid: uid 200 uid: uid
203 - }).then(result => { 201 + }, {code: 200}).then(result => {
204 return result; 202 return result;
205 }); 203 });
206 }; 204 };
@@ -213,12 +211,11 @@ const getShopBrands = (shopId) => { @@ -213,12 +211,11 @@ const getShopBrands = (shopId) => {
213 return api.get('', { 211 return api.get('', {
214 method: 'app.shops.getShopsBrands', 212 method: 'app.shops.getShopsBrands',
215 shop_id: shopId 213 shop_id: shopId
216 - }).then((result) => { 214 + }, {code: 200}).then((result) => {
217 if (result && result.code === 200) { 215 if (result && result.code === 200) {
218 result = camelCase(result.data); 216 result = camelCase(result.data);
219 return result[0].brandId; 217 return result[0].brandId;
220 } else { 218 } else {
221 - logger.error('gGet all the brands under the shop return code is not 200');  
222 return {}; 219 return {};
223 } 220 }
224 }); 221 });
@@ -234,7 +231,7 @@ const searchProductBySkn = (productSkn) => { @@ -234,7 +231,7 @@ const searchProductBySkn = (productSkn) => {
234 return api.get('', { 231 return api.get('', {
235 method: 'h5.product.batch', 232 method: 'h5.product.batch',
236 productSkn: productSkn, 233 productSkn: productSkn,
237 - }).then(result => { 234 + }, {code: 200}).then(result => {
238 return _.get(result, 'data.product_list', []); 235 return _.get(result, 'data.product_list', []);
239 }); 236 });
240 }; 237 };