BlockList.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import axiosApi from './AxiosApi.js'
  2. /**
  3. * 若后端要使用zuul服务,以下接口需要加一个前缀 /gate
  4. */
  5. const apiList = {
  6. page: {
  7. method: 'POST',
  8. url: `/gateway/blockList/page`,
  9. },
  10. query: {
  11. method: 'POST',
  12. url: `/gateway/blockList/query`,
  13. },
  14. update: {
  15. method: 'PUT',
  16. url: `/gateway/blockList`
  17. },
  18. save: {
  19. method: 'POST',
  20. url: `/gateway/blockList`
  21. },
  22. delete: {
  23. method: 'DELETE',
  24. url: `/gateway/blockList`
  25. },
  26. export: {
  27. method: 'POST',
  28. url: `/gateway/blockList/export`
  29. },
  30. preview: {
  31. method: 'POST',
  32. url: `/gateway/blockList/preview`
  33. },
  34. import: {
  35. method: 'POST',
  36. url: `/gateway/blockList/import`
  37. }
  38. }
  39. export default {
  40. page (data, custom = {}) {
  41. return axiosApi({
  42. ...apiList.page,
  43. data,
  44. custom
  45. })
  46. },
  47. query (data, custom = {}) {
  48. return axiosApi({
  49. ...apiList.query,
  50. data,
  51. custom
  52. })
  53. },
  54. save (data, custom = {}) {
  55. return axiosApi({
  56. ...apiList.save,
  57. data,
  58. custom
  59. })
  60. },
  61. update (data, custom = {}) {
  62. return axiosApi({
  63. ...apiList.update,
  64. data,
  65. custom
  66. })
  67. },
  68. delete (data, custom = {}) {
  69. return axiosApi({
  70. ...apiList.delete,
  71. data,
  72. custom
  73. })
  74. },
  75. export (data, custom = {}) {
  76. return axiosApi({
  77. ...apiList.export,
  78. responseType: "blob",
  79. data,
  80. custom
  81. })
  82. },
  83. preview (data, custom = {}) {
  84. return axiosApi({
  85. ...apiList.preview,
  86. data,
  87. custom
  88. })
  89. },
  90. import (data, custom = {}) {
  91. return axiosApi({
  92. ...apiList.import,
  93. data,
  94. custom
  95. })
  96. }
  97. }