zhengyiming
2025-07-31 048626512af9e86b6280fbc2ecfff33edf8eee31
src/constants/app.ts
@@ -1,4 +1,20 @@
export const AppType = import.meta.env.VITE_AppType || 'one';
export const AppType = import.meta.env.VITE_AppType || 'other';
export const isJYB =
  AppType === 'other' || AppType === 'jx' || AppType === 'jy' || AppType === 'backup';
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 };
  }
}