import request from '../utils/request.js' class product extends request { // static errorHandel(res) { // console.log(res); // } static async getProductList(productType=1,page = 1, pageSize = 10,type=1) { const res = await this.getRequest(`${this.BASE_URL}Product/index?productTypeId=${productType}&page=${page}&pageSize=${pageSize}&type=${type}`) return res.data; } static async getProductById(id) { const res = await this.getRequest(`${this.BASE_URL}Product/read?id=${id}`) return res.data; } static async getProductTypeList(page = 1, pageSize = 10,type=1) { const res = await this.getRequest(`${this.BASE_URL}Product/typeList?page=${page}&pageSize=${pageSize}&type=${type}`) return res.data; } static async getCart(data) { const res= await this.postRequest(`${this.BASE_URL}Order/getCart`,data) return res.data } static async updateCart(data) { const res = await this.postRequest(`${this.BASE_URL}Order/updateCart`,data) return res.data } } export default product