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 [];
|
||||
}
|
||||
}
|
||||
7
openim_common/pubspec.yaml
Normal file
7
openim_common/pubspec.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
name: openim_common
|
||||
description: Build-server compatible configuration bridge for the H5 shell.
|
||||
publish_to: 'none'
|
||||
|
||||
environment:
|
||||
sdk: ">=3.6.0 <4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user