2025-10-21
商品详情加入购物车与创建订单 支付页面70%
This commit is contained in:
@@ -7,7 +7,11 @@ const baseUrl = "http://192.168.0.26:3000"
|
||||
export const mallAPI = {
|
||||
getMallList: (params) => http.get(baseUrl + '/api/products', params),
|
||||
getCategory: () => http.get(baseUrl + '/api/category'),
|
||||
getMallDetail: (id) => http.get(baseUrl + '/api/products/' + id)
|
||||
getMallDetail: (id) => http.get(baseUrl + '/api/products/' + id),
|
||||
getRecommended: (id) => http.get(baseUrl + `/api/products/${id}/recommended`), // 推荐商品
|
||||
addCart: (data) => http.post(baseUrl +"/api/cart/add", data), // 添加购物车
|
||||
createOrder: (data) => http.post(baseUrl + `/api/orders/create-from-cart`,data), // 创建订单
|
||||
getOrder: (orderId) => http.get(baseUrl + `/api/orders/pending-payment/${orderId}`), // 获取订单
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user