comments.js 888 B

12345678910111213141516171819202122
  1. import request from '../utils/request.js'
  2. class comments extends request {
  3. static async getCommentsByProduct(page=1,pageSize=10,storeId, productId) {
  4. const res = await this.getRequest(`${this.BASE_URL}Discuss/index?page=${page}&pageSize=${pageSize}&productId=${productId}&storeId=${storeId}`, this._defaultHeader)
  5. return res.data;
  6. }
  7. static async getCommentsByStore(page=1,pageSize=10,storeId) {
  8. const res = await this.getRequest(`${this.BASE_URL}Discuss/index?page=${page}&pageSize=${pageSize}&storeId=${storeId}`, this._defaultHeader)
  9. return res.data;
  10. }
  11. static async getPersonComments(page=1,pageSize=10,myDiscuss=1) {
  12. const res = await this.getRequest(`${this.BASE_URL}Discuss/index?page=${page}&pageSize=${pageSize}&myDiscuss=${myDiscuss}`, this._defaultHeader)
  13. return res.data;
  14. }
  15. }
  16. export default comments;