霖雨寺

This commit is contained in:
wenfp
2026-07-27 09:57:35 +08:00
commit 6e531cf7af
57 changed files with 7529 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { request } from './http';
export type UploadResponse = {
url: string;
object_key: string;
};
export function uploadImage(file: Blob, folder = 'products') {
const formData = new FormData();
const filename = file instanceof File ? file.name : 'image';
formData.append('file', file, filename);
formData.append('folder', folder);
return request<UploadResponse>('/uploads/images', {
method: 'POST',
body: formData,
});
}