20260629154839
This commit is contained in:
1 parent
e687846eb4
commit
bb596f3245
41 files changed
+5735
-86
No files matched your search
@@ -81,8 +81,22 @@ export function saveDataApi(params: SaveDataParams[]) {
|
||||
return alovaInstance.Post<ResponseData<null>>(`/data/saveData`, params);
|
||||
}
|
||||
|
||||
export function s3UploadFileApi(files: any[]) {
|
||||
interface S3UploadOptions {
|
||||
familyId?: number;
|
||||
uploadType?: "avatar";
|
||||
}
|
||||
|
||||
export function s3UploadFileApi(files: any[], options: number | S3UploadOptions) {
|
||||
const form = new FormData();
|
||||
const uploadOptions = typeof options === "number" ? { familyId: options } : options;
|
||||
|
||||
if (uploadOptions.familyId) {
|
||||
form.append("family_id", String(uploadOptions.familyId));
|
||||
}
|
||||
|
||||
if (uploadOptions.uploadType) {
|
||||
form.append("upload_type", uploadOptions.uploadType);
|
||||
}
|
||||
|
||||
files.forEach((file) => {
|
||||
form.append("files", file as any);
|
||||
@@ -95,6 +109,13 @@ export function s3UploadFileApi(files: any[]) {
|
||||
});
|
||||
}
|
||||
|
||||
export function s3CopyFilesApi(familyId: number, keys: string[]) {
|
||||
return alovaInstance.Post<ResponseData<string[]>>("/s3/copy", {
|
||||
family_id: familyId,
|
||||
keys,
|
||||
});
|
||||
}
|
||||
|
||||
export function s3DeleteFileApi(keys: string[]) {
|
||||
return alovaInstance.Post<ResponseData<null>>("/s3/delete", {
|
||||
keys,
|
||||
|
||||
Reference in new issue
Block a user