util.js 577 B

123456789101112131415161718
  1. import { defineStore } from 'pinia'
  2. import { AxiosWrapper } from '@/utils/axios-wrapper'
  3. const axios = new AxiosWrapper()
  4. export const UtilStore = defineStore('util', () => {
  5. const toImport = async (payload) => {
  6. const res = await axios.$post(`/util/toImport`, payload)
  7. return res
  8. }
  9. const toExport = async (payload) => {
  10. const res = await axios.$post(`/util/toExport`, payload)
  11. return res
  12. }
  13. const toTotal = async (payload) => {
  14. const res = await axios.$post(`/util/toTotal`, payload)
  15. return res
  16. }
  17. return { toImport, toExport, toTotal }
  18. })