Browse Source

产品详情页问题

yangc 7 years ago
parent
commit
7ed21c7d98
1 changed files with 5 additions and 5 deletions
  1. 5 5
      store/shop.js

+ 5 - 5
store/shop.js

@@ -44,17 +44,17 @@ export const actions = {
       .then(response => {
         commit('storeInfo/GET_COMMODITY_SUCCESS', response.data)
         let commodity = response.data || {}
-        if(commodity.uuid) {
-          commit('storeInfo/REQUEST_COMPONENT')
+        commit('storeInfo/REQUEST_COMPONENT')
+        if (commodity.uuid) {
           return axios.get(`/api/commodity/component/${commodity.uuid}`)
             .then(response => {
               commit('storeInfo/GET_COMPONENT_SUCCESS', response.data)
-              return Promise.all([
-                findStoreInfoFromUuid({ commit }, {uuid: commodity.storeid})
-              ])
+              return findStoreInfoFromUuid({ commit }, {uuid: commodity.storeid})
             }, err => {
               commit('storeInfo/GET_COMPONENT_FAILURE', err)
             })
+        } else {
+          return findStoreInfoFromUuid({ commit }, {uuid: commodity.storeid})
         }
       }, err => {
         commit('storeInfo/GET_COMMODITY_FAILURE', err)