feat: 重构环境配置,移除 openim_common 依赖并优化主页 URL 获取逻辑
This commit is contained in:
@@ -1,8 +1,18 @@
|
|||||||
import 'package:openim_common/openim_common.dart' as openim_common;
|
enum Environment {
|
||||||
|
production,
|
||||||
|
}
|
||||||
|
|
||||||
class AppConfig {
|
class AppConfig {
|
||||||
|
static const Environment currentEnvironment = Environment.production;
|
||||||
|
|
||||||
|
static final Map<Environment, List<String>> _environmentHosts = {
|
||||||
|
Environment.production: [
|
||||||
|
'h5-im.imharry.work',
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
static List<String> get environmentHosts {
|
static List<String> get environmentHosts {
|
||||||
return openim_common.Config.environmentHosts;
|
return _environmentHosts[currentEnvironment] ?? const [];
|
||||||
}
|
}
|
||||||
|
|
||||||
static String get homeUrl {
|
static String get homeUrl {
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
enum Environment {
|
|
||||||
production,
|
|
||||||
}
|
|
||||||
|
|
||||||
class Config {
|
class Config {
|
||||||
static const Environment currentEnvironment = Environment.production;
|
static const List<String> defaultEnvironmentHosts = [
|
||||||
|
|
||||||
static final Map<Environment, List<String>> _environmentHosts = {
|
|
||||||
Environment.production: [
|
|
||||||
'h5-im.imharry.work',
|
'h5-im.imharry.work',
|
||||||
],
|
];
|
||||||
};
|
|
||||||
|
|
||||||
static List<String> get environmentHosts {
|
static List<String> get environmentHosts {
|
||||||
return _environmentHosts[currentEnvironment] ?? const [];
|
return defaultEnvironmentHosts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user