config.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import request from '@/utils/request'
  2. // 查询参数列表
  3. export function listConfig(query) {
  4. return request({
  5. url: '/system/config/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询参数详细
  11. export function getConfig(configId) {
  12. return request({
  13. url: '/system/config/' + configId,
  14. method: 'get'
  15. })
  16. }
  17. export function getConfigByKey(configKey) {
  18. return request({
  19. url: '/system/config/getConfigByKey/' + configKey,
  20. method: 'get'
  21. })
  22. }
  23. // 根据参数键名查询参数值
  24. export function getConfigKey(configKey) {
  25. return request({
  26. url: '/system/config/configKey/' + configKey,
  27. method: 'get'
  28. })
  29. }
  30. // 新增参数配置
  31. export function addConfig(data) {
  32. return request({
  33. url: '/system/config',
  34. method: 'post',
  35. data: data
  36. })
  37. }
  38. // 修改参数配置
  39. export function updateConfig(data) {
  40. return request({
  41. url: '/system/config',
  42. method: 'put',
  43. data: data
  44. })
  45. }
  46. // 删除参数配置
  47. export function delConfig(configId) {
  48. return request({
  49. url: '/system/config/' + configId,
  50. method: 'delete'
  51. })
  52. }
  53. // 刷新参数缓存
  54. export function refreshCache() {
  55. return request({
  56. url: '/system/config/refreshCache',
  57. method: 'delete'
  58. })
  59. }
  60. // 导出参数
  61. export function exportConfig(query) {
  62. return request({
  63. url: '/system/config/export',
  64. method: 'get',
  65. params: query
  66. })
  67. }
  68. export function updateConfigByKey(data) {
  69. return request({
  70. url: '/system/config/updateConfigByKey',
  71. method: 'post',
  72. data: data
  73. })
  74. }