Files
ipms-sjy/yudao-ui-admin-vue3/src/api/infra/config/index.ts

40 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-07-19 22:33:54 +08:00
import { useAxios } from '@/hooks/web/useAxios'
2022-07-18 19:06:37 +08:00
import type { ConfigVO } from './types'
2022-07-19 22:33:54 +08:00
const request = useAxios()
2022-07-18 19:06:37 +08:00
// 查询参数列表
2022-07-19 22:33:54 +08:00
export const getConfigPageApi = (params) => {
return request.get({ url: '/infra/config/page', params })
2022-07-18 19:06:37 +08:00
}
// 查询参数详情
export const getConfigApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.get({ url: '/infra/config/get?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 根据参数键名查询参数值
export const getConfigKeyApi = (configKey: string) => {
2022-07-19 22:33:54 +08:00
return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
2022-07-18 19:06:37 +08:00
}
// 新增参数
2022-07-19 22:33:54 +08:00
export const createConfigApi = (data: ConfigVO) => {
return request.post({ url: '/infra/config/create', data })
2022-07-18 19:06:37 +08:00
}
// 修改参数
2022-07-19 22:33:54 +08:00
export const updateConfigApi = (data: ConfigVO) => {
return request.put({ url: '/infra/config/update', data })
2022-07-18 19:06:37 +08:00
}
// 删除参数
export const deleteConfigApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.delete({ url: '/infra/config/delete?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 导出参数
2022-07-19 22:33:54 +08:00
export const exportConfigApi = (params) => {
return request.get({ url: '/infra/config/export', params, responseType: 'blob' })
2022-07-18 19:06:37 +08:00
}