From 65fdfc6dd82f0bcf6c6826fe1ab645b309f6045c Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 23 十月 2025 19:37:06 +0800
Subject: [PATCH] fix: bug
---
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