12345678910111213141516171819202122232425 |
- 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
|