From 048626512af9e86b6280fbc2ecfff33edf8eee31 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期四, 31 七月 2025 15:50:57 +0800 Subject: [PATCH] fix: 新增生煎保(短期方案) --- src/constants/app.ts | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/constants/app.ts b/src/constants/app.ts index b435003..cca756e 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -1 +1,20 @@ export const AppType = import.meta.env.VITE_AppType || 'other'; + +export class Platform { + static OS = AppType; + + static isJX = Platform.OS === 'jx'; + static isTP = Platform.OS === 'tp'; + + static select<T>(config: Partial<Record<typeof Platform.OS, T>>): T { + return config[Platform.OS]; + } + + static selectWithBase<TBase extends object, T extends object>( + base: TBase, + config: Partial<Record<typeof Platform.OS, T>> + ) { + const osConfig = config[Platform.OS] || ({} as T); + return { ...base, ...osConfig }; + } +} -- Gitblit v1.9.1