index.ts 457 B

1234567891011121314151617181920
  1. import { ref, onUnmounted } from 'vue'
  2. import { queryConfig } from '@/services/api/common'
  3. export function getConfigValue(configid: number) {
  4. const configValue = ref('')
  5. const controller = new AbortController()
  6. // 获取配置项
  7. queryConfig({
  8. controller,
  9. data: { configid }
  10. }).then((res) => {
  11. configValue.value = res.data.configvalue
  12. })
  13. onUnmounted(() => controller.abort())
  14. return configValue
  15. }