store.ts 596 B

1234567891011121314151617181920212223242526
  1. import {axios} from '../utils/request'
  2. import {STORE_MODULE} from './_prefix'
  3. // 创建商店
  4. export const createStore = payload => {
  5. return axios.post(`${STORE_MODULE}/create`, payload)
  6. .then(res => {
  7. return res;
  8. })
  9. }
  10. // 获取全部商店
  11. export const getAllStore = payload => {
  12. return axios.get(`${STORE_MODULE}/`, payload)
  13. .then(res => {
  14. return res;
  15. })
  16. }
  17. // 获取指定商店
  18. export const getStoreById = storeId => {
  19. return axios.get(`${STORE_MODULE}/?id=${storeId}`)
  20. .then(res => {
  21. return res;
  22. })
  23. }