index.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { defHttp } from '@/config/axios'
  2. import type { ConfigVO } from './types'
  3. // 查询参数列表
  4. export const getConfigPageApi = ({ params }) => {
  5. return defHttp.get<PageResult<ConfigVO>>({ url: '/infra/config/page', params })
  6. }
  7. // 查询参数详情
  8. export const getConfigApi = (id: number) => {
  9. return defHttp.get<ConfigVO>({ url: '/infra/config/get?id=' + id })
  10. }
  11. // 根据参数键名查询参数值
  12. export const getConfigKeyApi = (configKey: string) => {
  13. return defHttp.get<ConfigVO>({ url: '/infra/config/get-value-by-key?key=' + configKey })
  14. }
  15. // 新增参数
  16. export const createConfigApi = (params: ConfigVO) => {
  17. return defHttp.post({ url: '/infra/config/create', params })
  18. }
  19. // 修改参数
  20. export const updateConfigApi = (params: ConfigVO) => {
  21. return defHttp.put({ url: '/infra/config/update', params })
  22. }
  23. // 删除参数
  24. export const deleteConfigApi = (id: number) => {
  25. return defHttp.delete({ url: '/infra/config/delete?id=' + id })
  26. }
  27. // 导出参数
  28. export const exportConfigApi = ({ params }) => {
  29. return defHttp.get({ url: '/infra/config/export', params, responseType: 'blob' })
  30. }