| | |
| | | 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 }; |
| | | } |
| | | } |