...
|
...
|
@@ -15,7 +15,7 @@ export default { |
|
|
content_code: '05e4f5782dfc3a5e10d39b8f04a7dcb9',
|
|
|
};
|
|
|
}
|
|
|
return this.$api.get(`/api/ufo/product${path}`, params).then(result => {
|
|
|
return this.$api.post(`/api/ufo/product${path}`, params).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
return result.data;
|
|
|
} else {
|
...
|
...
|
@@ -35,7 +35,7 @@ export default { |
|
|
}));
|
|
|
},
|
|
|
async fetchRecommendProduct({ commit }, { productId }) {
|
|
|
const result = await this.$api.get('/api/ufo/product/recommend', { product_id: productId })
|
|
|
const result = await this.$api.post('/api/ufo/product/recommend', { product_id: productId })
|
|
|
|
|
|
return result?.data?.product_list ?? []
|
|
|
},
|
...
|
...
|
@@ -52,7 +52,7 @@ export default { |
|
|
return false;
|
|
|
}
|
|
|
|
|
|
const isFav = await this.$api.get('/api/ufo/product/fav', { productId }).then(result => {
|
|
|
const isFav = await this.$api.post('/api/ufo/product/fav', { productId }).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
return result.data;
|
|
|
} else {
|
...
|
...
|
@@ -63,7 +63,7 @@ export default { |
|
|
commit(Types.UPDATE_PRODUCT_FAV, { productId, isFav });
|
|
|
},
|
|
|
async fetchTop3({ commit }, { productId }) {
|
|
|
const result = await this.$api.get('/api/ufo/product/top', { product_id: productId });
|
|
|
const result = await this.$api.post('/api/ufo/product/top', { product_id: productId });
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
const productList = result.data.product_list || [];
|
...
|
...
|
@@ -72,7 +72,7 @@ export default { |
|
|
}
|
|
|
},
|
|
|
async toggleFav({ commit }, { productId, isFav }) {
|
|
|
const result = await this.$api.get(`/api/ufo/product/favorite/${isFav ? 'add' : 'cancel'}`, { productId });
|
|
|
const result = await this.$api.post(`/api/ufo/product/favorite/${isFav ? 'add' : 'cancel'}`, { productId });
|
|
|
|
|
|
if (result && result.code === 200) {
|
|
|
commit(Types.UPDATE_PRODUCT_FAV, { productId, isFav });
|
...
|
...
|
@@ -106,7 +106,7 @@ export default { |
|
|
async requestSize({ state }, { product_id, goods_id, size_ids }) {
|
|
|
const selectedProduct = state.selectedProductInfo;
|
|
|
|
|
|
await this.$api.get('/api/ufo/product/addsize', {
|
|
|
await this.$api.post('/api/ufo/product/addsize', {
|
|
|
product_id,
|
|
|
goods_id,
|
|
|
size_ids,
|
...
|
...
|
|