feat: 接入对象存储图片直传

This commit is contained in:
que01 committed 2026-10-12 00:55:30 +08:00
1 parent f57c0ca0ea
commit 84956b8fe2
14 files changed
+548 -15

No files matched your search

+20
View File
@@ -54,6 +54,16 @@ export interface AdminBrandMember {
isEnabled: boolean;
};
}
export interface UploadConfig {
configured: boolean;
}
export interface PresignedUpload {
uploadUrl: string;
key: string;
publicUrl: string;
}
export type BrandUpdate = Partial<Omit<BrandProfile, "id">>;
export interface BrandReleaseSummary {
id: string;
@@ -869,6 +879,16 @@ export class ApiClient {
method: "DELETE",
});
}
getUploadConfig(): Promise<UploadConfig> {
return this.request("/admin/uploads/config");
}
createPresignedUpload(body: {
fileName: string;
contentType: string;
scope?: "brand" | "offering" | "trust";
}): Promise<PresignedUpload> {
return this.request("/admin/uploads/presign", { method: "POST", body });
}
private async request<T>(
path: string,
options: { method?: string; body?: unknown } = {},