feat(web): 主题设置联动 — 扩展 ThemeConfig 品牌字段 + 设置页面表单
- ThemeConfig 接口增加 brand_name/brand_slogan/brand_features/brand_copyright - 新增 BrandConfig 接口和 getPublicBrand 公开品牌信息获取 - app store 增加 themeConfig 缓存和 loadThemeConfig 方法 - ThemeSettings 页面增加品牌设置表单(品牌名称/标语/特性/版权)
This commit is contained in:
@@ -4,6 +4,10 @@ export interface ThemeConfig {
|
||||
primary_color?: string;
|
||||
logo_url?: string;
|
||||
sidebar_style?: 'light' | 'dark';
|
||||
brand_name?: string;
|
||||
brand_slogan?: string;
|
||||
brand_features?: string;
|
||||
brand_copyright?: string;
|
||||
}
|
||||
|
||||
export async function getTheme() {
|
||||
@@ -20,3 +24,26 @@ export async function updateTheme(theme: ThemeConfig) {
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export interface BrandConfig {
|
||||
brand_name: string;
|
||||
brand_slogan: string;
|
||||
brand_features: string;
|
||||
brand_copyright: string;
|
||||
}
|
||||
|
||||
const BRAND_DEFAULTS: BrandConfig = {
|
||||
brand_name: 'HMS 健康管理平台',
|
||||
brand_slogan: '新一代健康管理平台',
|
||||
brand_features: '患者管理 · 健康监测 · 随访管理 · AI 智能分析',
|
||||
brand_copyright: 'HMS 健康管理平台 · ©汕头市智界科技有限公司',
|
||||
};
|
||||
|
||||
export async function getPublicBrand(): Promise<BrandConfig> {
|
||||
try {
|
||||
const res = await fetch('/api/v1/public/brand');
|
||||
const json = await res.json();
|
||||
if (json?.success && json?.data) return json.data;
|
||||
} catch {}
|
||||
return BRAND_DEFAULTS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user