store.js 750 B

123456789101112131415161718192021222324252627
  1. import request from '../utils/request.js'
  2. class store extends request{
  3. // static errorHandel(res) {
  4. // console.log(res);
  5. // }
  6. static async getStoreList(page = 1, pageSize = 10) {
  7. const res = await this.getRequest(`${this.BASE_URL}Store/index?page=${page}&pageSize=${pageSize}`, this._defaultHeader)
  8. return res.data;
  9. }
  10. static async getStoreById(id) {
  11. const res = await this.getRequest(`${this.BASE_URL}Store/read?id=${id}`, this._defaultHeader)
  12. return res.data;
  13. }
  14. static async getNearStore(lat, lon) {
  15. const res = await this.postRequest(`${this.BASE_URL}Store/getStore`, {
  16. lat,
  17. lon
  18. })
  19. return res.data;
  20. }
  21. }
  22. export default store