system.js 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. import { ref, computed } from 'vue'
  2. import { defineStore } from 'pinia'
  3. import { http } from '@/plugins/http'
  4. import { retry } from '@/utils/utils'
  5. export const useSystemStore = defineStore('system', () => {
  6. const riseRate = ref(0)
  7. const platformCommission = ref(0)
  8. const saleBatches = ref([])
  9. const vipEnabled = ref(false)
  10. const riseRatePercent = computed(() => {
  11. return riseRate.value * 100
  12. })
  13. function getSysConfigs() {
  14. // retry(() => http.get('/sysConfig/get/max_rise_rate')).then(res => {
  15. // riseRate.value = Number(res.value)
  16. // })
  17. // retry(() => http.get('/sysConfig/get/platform_commission')).then(res => {
  18. // platformCommission.value = Number(res.value)
  19. // })
  20. // retry(() => http.post('/saleBatch/all', { size: 10000 }, { body: 'json' })).then(res => {
  21. // saleBatches.value = res.content
  22. // })
  23. // retry(() => http.get('/sysConfig/get/vip_enabled')).then(res => {
  24. // vipEnabled.value = res.value == '1'
  25. // })
  26. }
  27. return { riseRate, riseRatePercent, platformCommission, saleBatches, getSysConfigs, vipEnabled }
  28. })