feat: 增加多品牌切换并继续拆分控制器

This commit is contained in:
que01 committed 2026-09-23 11:59:01 +08:00
1 parent f4a93bba23
commit 045472035b
7 files changed
+126 -3

No files matched your search

+13
View File
@@ -25,6 +25,11 @@ export interface BrandProfile {
contactWechat: string | null;
config?: Record<string, unknown> | null;
}
export interface AdminBrandMembership {
id: string;
role: string;
brand: Pick<BrandProfile, "id" | "name" | "templateKey"> & { slug?: string };
}
export type BrandUpdate = Partial<Omit<BrandProfile, "id">>;
export interface OfferingUpdate {
name?: string;
@@ -398,6 +403,14 @@ export class ApiClient {
getAdminBrand(): Promise<BrandProfile> {
return this.request("/admin/config/brand");
}
listAdminBrands(): Promise<AdminBrandMembership[]> {
return this.request("/admin/brands");
}
switchAdminBrand(
brandId: string,
): Promise<{ token: string; brand: AdminBrandMembership["brand"] }> {
return this.request(`/admin/brands/${encodeURIComponent(brandId)}/switch`, { method: "POST" });
}
getAdminVisualTemplatePreview(): Promise<{
current: {
key: string;