Authored by 郭成尧

add-to-cart-no-uid

@@ -70,18 +70,21 @@ const detail = (params, isApp) => { @@ -70,18 +70,21 @@ const detail = (params, isApp) => {
70 * @param {*} params 70 * @param {*} params
71 */ 71 */
72 const addToCart = (params) => { 72 const addToCart = (params) => {
73 - if (!params.uid) {  
74 - return Promise.resolve({});  
75 - }  
76 let skuList = params.product_sku_list; 73 let skuList = params.product_sku_list;
77 -  
78 - return api.post('', { 74 + let finalParams = {
79 method: 'app.Shopping.addBundle', 75 method: 'app.Shopping.addBundle',
80 - uid: params.uid,  
81 shopping_key: params.shopping_key, 76 shopping_key: params.shopping_key,
82 activity_id: params.activity_id, 77 activity_id: params.activity_id,
83 product_sku_list: skuList 78 product_sku_list: skuList
84 - }, { 79 + };
  80 +
  81 + if (params.uid) {
  82 + Object.assign(finalParams, {
  83 + uid: params.uid
  84 + });
  85 + }
  86 +
  87 + return api.post('', finalParams, {
85 headers: { 88 headers: {
86 'User-Agent': params.userAgent 89 'User-Agent': params.userAgent
87 } 90 }