18 lines
443 B
TypeScript
Raw Normal View History

2025-02-14 21:06:24 +08:00
import { http } from "@/utils/http";
import type { FileInfo } from "types/file";
/**上传文件 */
export const postUploadFileAPI = (data: { file: Blob }) => {
return http.request<FileInfo>("post", "/api/file/upload", {
data,
headers: {
"Content-Type": "multipart/form-data"
}
});
};
/**删除文件 */
export const deleteFileAPI = (id: string) => {
return http.request<null>("delete", `/api/file/delete/${id}`);
};