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