config.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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',
  20. method: 'get',
  21. params: { configKey }
  22. })
  23. }
  24. // 根据参数键名查询参数值
  25. export function getConfigKey(configKey) {
  26. return request({
  27. url: '/system/config/configKey/' + configKey,
  28. method: 'get'
  29. })
  30. }
  31. // 新增参数配置
  32. export function addConfig(data) {
  33. return request({
  34. url: '/system/config',
  35. method: 'post',
  36. data: data
  37. })
  38. }
  39. // 修改参数配置
  40. export function updateConfig(data) {
  41. return request({
  42. url: '/system/config',
  43. method: 'put',
  44. data: data
  45. })
  46. }
  47. // 删除参数配置
  48. export function delConfig(configId) {
  49. return request({
  50. url: '/system/config/' + configId,
  51. method: 'delete'
  52. })
  53. }
  54. // 刷新参数缓存
  55. export function refreshCache() {
  56. return request({
  57. url: '/system/config/refreshCache',
  58. method: 'delete'
  59. })
  60. }
  61. // 导出参数
  62. export function exportConfig(query) {
  63. return request({
  64. url: '/system/config/export',
  65. method: 'get',
  66. params: query
  67. })
  68. }
  69. export function updateConfigByKey(data) {
  70. return request({
  71. url: '/system/config/updateConfigByKey',
  72. method: 'post',
  73. data: data
  74. })
  75. }
  76. export function updateIsTownOn(query) {
  77. return request({
  78. url: '/system/config/updateIsTownOn',
  79. method: 'get',
  80. params: query
  81. })
  82. }