freight-web/src/services/picture.ts

61 lines
1.1 KiB
TypeScript

import type { ImagesType } from "@/utils/enum";
import { http } from "@/utils/http";
// 资源存储接口
export const addAnnex = (data: any) => {
return http({
method: "POST",
url: "/api/annex/addAnnex",
data,
});
};
// 获取图片资源
export const getAnnex = (data: {businessId: string, orderType: number, imagesType: ImagesType | any}) => {
return http<Resource>({
method: "GET",
url: "/api/annex/getAnnex",
data
});
};
// 批量存储资源
export const addListAnnex = (data: any) => {
return http({
method: "POST",
url: "/api/annex/addListAnnex",
data,
});
};
// 多个上传
export const uploadList = (data: any) => {
return http({
method: "POST",
header: {type: 'UPLOAD'},
url: "/api/file/uploadList",
data,
});
};
// 单个上传
export const upload = (data: any) => {
return http({
method: "POST",
header: {type: 'UPLOAD'},
url: "/api/file/upload",
data,
});
};
// 删除图片
export const deleteById = (data: any) => {
return http({
method: "POST",
url: "/api/annex/delete",
data,
});
};