Showing
3 changed files
with
11 additions
and
8 deletions
@@ -237,6 +237,10 @@ const brand = (req, res, next) => { | @@ -237,6 +237,10 @@ const brand = (req, res, next) => { | ||
237 | } | 237 | } |
238 | 238 | ||
239 | listModel.getBrandLogoByDomain(domain).then(result => { | 239 | listModel.getBrandLogoByDomain(domain).then(result => { |
240 | + if (!result) { | ||
241 | + return next(); | ||
242 | + } | ||
243 | + | ||
240 | brandLogo = result; | 244 | brandLogo = result; |
241 | 245 | ||
242 | title = brandLogo.name; | 246 | title = brandLogo.name; |
@@ -942,13 +942,10 @@ let _getPromotionInfo = (skn) => { | @@ -942,13 +942,10 @@ let _getPromotionInfo = (skn) => { | ||
942 | method: 'app.product.promotion', | 942 | method: 'app.product.promotion', |
943 | product_skn: _.toString(skn) | 943 | product_skn: _.toString(skn) |
944 | }, { | 944 | }, { |
945 | + code: 200, | ||
945 | cache: true | 946 | cache: true |
946 | }).then((result) => { | 947 | }).then((result) => { |
947 | - if (result.code === 200) { | ||
948 | - return result.data; | ||
949 | - } | ||
950 | - | ||
951 | - return {}; | 948 | + return result && result.data; |
952 | }); | 949 | }); |
953 | }; | 950 | }; |
954 | 951 |
@@ -599,7 +599,7 @@ const getBrandIntro = (brandId, uid) => { | @@ -599,7 +599,7 @@ const getBrandIntro = (brandId, uid) => { | ||
599 | code: 200, | 599 | code: 200, |
600 | cache: true | 600 | cache: true |
601 | }).then(result => { | 601 | }).then(result => { |
602 | - | 602 | + if (result && result.data) { |
603 | let list = result.data; | 603 | let list = result.data; |
604 | 604 | ||
605 | return { | 605 | return { |
@@ -608,7 +608,9 @@ const getBrandIntro = (brandId, uid) => { | @@ -608,7 +608,9 @@ const getBrandIntro = (brandId, uid) => { | ||
608 | collected: list.is_favorite && list.is_favorite === 'Y', | 608 | collected: list.is_favorite && list.is_favorite === 'Y', |
609 | title: list.brand_name ? list.brand_name : '' | 609 | title: list.brand_name ? list.brand_name : '' |
610 | }; | 610 | }; |
611 | - | 611 | + } else { |
612 | + return false; | ||
613 | + } | ||
612 | }); | 614 | }); |
613 | }; | 615 | }; |
614 | 616 | ||
@@ -650,7 +652,7 @@ const getBrandLogoByDomain = (domain) => { | @@ -650,7 +652,7 @@ const getBrandLogoByDomain = (domain) => { | ||
650 | code: 200, | 652 | code: 200, |
651 | cache: true | 653 | cache: true |
652 | }).then(result => { | 654 | }).then(result => { |
653 | - if (result.data) { | 655 | + if (result && result.data) { |
654 | let formatData = result.data; | 656 | let formatData = result.data; |
655 | 657 | ||
656 | return { | 658 | return { |
-
Please register or login to post a comment