Attachment.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import axiosApi from './AxiosApi.js'
  2. const apiList = {
  3. page: {
  4. method: 'POST',
  5. url: `/file/attachment/page`
  6. },
  7. upload: {
  8. method: 'POST',
  9. url: `/file/attachment/upload`
  10. },
  11. download: {
  12. method: 'GET',
  13. url: `/file/attachment/download`
  14. },
  15. downloadBiz: {
  16. method: 'GET',
  17. url: `/file/attachment/download/biz`
  18. },
  19. downloadUrl: {
  20. method: 'GET',
  21. url: `/file/attachment/download/url`
  22. },
  23. delete: {
  24. method: 'DELETE',
  25. url: `/file/attachment`
  26. }
  27. }
  28. export default {
  29. page (data) {
  30. return axiosApi({
  31. ...apiList.page,
  32. data
  33. })
  34. },
  35. upload (data) {
  36. return axiosApi({
  37. ...apiList.upload,
  38. data
  39. })
  40. },
  41. download (data) {
  42. return axiosApi({
  43. ...apiList.download,
  44. responseType: "blob",
  45. data
  46. })
  47. },
  48. downloadBiz (data) {
  49. return axiosApi({
  50. ...apiList.downloadBiz,
  51. data
  52. })
  53. },
  54. downloadUrl (data) {
  55. return axiosApi({
  56. ...apiList.downloadUrl,
  57. data
  58. })
  59. },
  60. delete (data) {
  61. return axiosApi({
  62. ...apiList.delete,
  63. data
  64. })
  65. }
  66. }