product.js 565 B

12345678910111213141516171819
  1. import request from '../utils/request.js'
  2. class product extends request {
  3. // static errorHandel(res) {
  4. // console.log(res);
  5. // }
  6. static async getProductList(productType=1,page = 1, pageSize = 10) {
  7. const res = await this.getRequest(`${this.BASE_URL}Product/index?productType=${productType}&page=${page}&pageSize=${pageSize}`)
  8. return res.data;
  9. }
  10. static async getProductById(id) {
  11. const res = await this.getRequest(`${this.BASE_URL}Product/read?id=${id}`)
  12. return res.data;
  13. }
  14. }
  15. export default product