feat: 添加 openim_common 依赖,重构环境配置和主页 URL 获取逻辑
This commit is contained in:
2
openim_common/lib/openim_common.dart
Normal file
2
openim_common/lib/openim_common.dart
Normal file
@@ -0,0 +1,2 @@
|
||||
export 'src/config.dart';
|
||||
|
||||
17
openim_common/lib/src/config.dart
Normal file
17
openim_common/lib/src/config.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
enum Environment {
|
||||
production,
|
||||
}
|
||||
|
||||
class Config {
|
||||
static const Environment currentEnvironment = Environment.production;
|
||||
|
||||
static final Map<Environment, List<String>> _environmentHosts = {
|
||||
Environment.production: [
|
||||
'h5-im.imharry.work',
|
||||
],
|
||||
};
|
||||
|
||||
static List<String> get environmentHosts {
|
||||
return _environmentHosts[currentEnvironment] ?? const [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user