123456789101112131415161718192021222324252627282930313233343536 |
- import { defineStore } from 'pinia'
- import { AxiosWrapper } from '@/utils/axios-wrapper'
- const url = '/statistics'
- const axios = new AxiosWrapper()
- export const StatisticsStore = defineStore('statistics', () => {
- const work = async ({ skip = 0, limit = undefined, ...info } = {}) => {
- let cond = {}
- if (skip) cond.skip = skip
- if (limit) cond.limit = limit
- cond = { ...cond, ...info }
- const res = await axios.$get(`${url}`, cond)
- return res
- }
- const user = async ({ skip = 0, limit = undefined, ...info } = {}) => {
- let cond = {}
- if (skip) cond.skip = skip
- if (limit) cond.limit = limit
- cond = { ...cond, ...info }
- const res = await axios.$get(`${url}`, cond)
- return res
- }
- const resource = async ({ skip = 0, limit = undefined, ...info } = {}) => {
- let cond = {}
- if (skip) cond.skip = skip
- if (limit) cond.limit = limit
- cond = { ...cond, ...info }
- const res = await axios.$get(`${url}`, cond)
- return res
- }
- return {
- work,
- user,
- resource
- }
- })
|