Authored by 郭成尧

weshare-id-uid-verify

@@ -3,12 +3,17 @@ @@ -3,12 +3,17 @@
3 */ 3 */
4 'use strict'; 4 'use strict';
5 const serviceApi = global.yoho.ServiceAPI; 5 const serviceApi = global.yoho.ServiceAPI;
  6 +const _ = require('lodash');
6 7
7 /** 8 /**
8 * 从接口获取 share 内容 9 * 从接口获取 share 内容
9 * @returns {*|Promise.<TResult>} 10 * @returns {*|Promise.<TResult>}
10 */ 11 */
11 const getShareContent = (params) => { 12 const getShareContent = (params) => {
  13 + if (!_.isNumber(params.shareId)) {
  14 + return Promise.resolve({});
  15 + }
  16 +
12 return serviceApi.get('operations/api/v5/webshare/getShare', { 17 return serviceApi.get('operations/api/v5/webshare/getShare', {
13 share_id: params.shareId 18 share_id: params.shareId
14 }).then(result => { 19 }).then(result => {
@@ -131,7 +131,7 @@ const getShopIntro = (shopId, uid) => { @@ -131,7 +131,7 @@ const getShopIntro = (shopId, uid) => {
131 shop_id: shopId 131 shop_id: shopId
132 }; 132 };
133 133
134 - if (uid) { 134 + if (uid && uid !== 'undefined') {
135 params.uid = uid; 135 params.uid = uid;
136 } 136 }
137 137
@@ -582,7 +582,8 @@ const getShopData = (req, shopId, uid, isApp) => { @@ -582,7 +582,8 @@ const getShopData = (req, shopId, uid, isApp) => {
582 let seoResult = _getBrandShopSeo(channel, shopInfoResult, req.query); 582 let seoResult = _getBrandShopSeo(channel, shopInfoResult, req.query);
583 583
584 /* 基础店铺返回程序内的跳转信号,跳转到基础店铺 */ 584 /* 基础店铺返回程序内的跳转信号,跳转到基础店铺 */
585 - if (shopInfoResult && shopInfoResult.shop_template_type && parseInt(shopInfoResult.shop_template_type, 10) === 1) { 585 + if (shopInfoResult && shopInfoResult.shop_template_type &&
  586 + parseInt(shopInfoResult.shop_template_type, 10) === 1) {
586 return { 587 return {
587 goBrand: shopInfoResult 588 goBrand: shopInfoResult
588 }; 589 };
@@ -625,12 +626,10 @@ const getShopData = (req, shopId, uid, isApp) => { @@ -625,12 +626,10 @@ const getShopData = (req, shopId, uid, isApp) => {
625 626
626 if (result[0]) { 627 if (result[0]) {
627 shopFilterSearchData.filter = productProcess.processFilter(result[0].filter || []); 628 shopFilterSearchData.filter = productProcess.processFilter(result[0].filter || []);
628 - shopFilterSearchData.goods = productProcess.processProductList(result[0].product_list || [], {isApp: isApp}); 629 + shopFilterSearchData.goods =
  630 + productProcess.processProductList(result[0].product_list || [], {isApp: isApp});
629 } 631 }
630 632
631 - /* 店铺优惠券 */  
632 - let shopCoupons = result[1] || [];  
633 -  
634 // 店铺分类 633 // 店铺分类
635 return _getShopCategory(shopId, channel).then(shopCategory => { 634 return _getShopCategory(shopId, channel).then(shopCategory => {
636 635