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) { const res = await this.getRequest(`${this.BASE_URL}Product/index?productTypeId=${productType}&page=${page}&pageSize=${pageSize}`) 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) { const res = await this.getRequest(`${this.BASE_URL}Product/typeList?page=${page}&pageSize=${pageSize}`) return res.data; } } export default product