http.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import axios from "axios";
  2. import ListModule from "./index";
  3. export const https = ListModule.http({
  4. loadLocal(localFile: any) {
  5. return axios(localFile, {
  6. method: "GET",
  7. });
  8. },
  9. getAssetDetail(id: string) {
  10. return this.request(`/share/pack/detail/${id}`, {
  11. method: "GET",
  12. });
  13. },
  14. loadAsset(dbId: string, defineId: string, baseURL: string) {
  15. return this.request(`/list/${dbId}/${defineId}`, {
  16. method: "GET",
  17. baseURL,
  18. });
  19. },
  20. createArtifact(data: any) {
  21. return this.request("/antique/create", {
  22. method: "POST",
  23. data: data,
  24. });
  25. },
  26. updateArtifact(data: any) {
  27. return this.request(`/antique/update`, { method: "POST", data });
  28. },
  29. getArtifactDtl(id: string) {
  30. return this.request(`/antique/detail/${id}`, {
  31. method: "GET",
  32. });
  33. },
  34. deleteArtifact(id: string) {
  35. return this.request(`/antique/delete/${id}`, {
  36. method: "POST",
  37. });
  38. },
  39. exportArtifact(data: any) {
  40. return this.request("/antique/export", {
  41. method: "POST",
  42. data,
  43. });
  44. },
  45. importArtifact() {
  46. return this.request("/antique/import", {
  47. method: "POST",
  48. });
  49. },
  50. getExport(id: string) {
  51. return this.request(`/anitique/file/${id}`, {
  52. method: "GET",
  53. });
  54. },
  55. });