mapHost method
映射线上域名到配置的域名
Implementation
String? mapHost(String standardHost) {
String? result = standardHost;
if (_allConfigs != null && _allConfigs!.isNotEmpty) {
//第一个作为标准
ServerEnvConfig standard = _allConfigs![0];
// ServerEnvConfig(index: 0, name: '线上环境', canEdit: false, envs: {
// 'PASSPORT_URL': 'https://passport.demo.com',
// 'BIZ_URL': 'https://biz.demo.com',
// 'other': 'someConfigs'
// }),
standard.envs!.forEach((key, value) {
if (standardHost == value) {
result = config!.envs![key];
return;
}
});
}
return result;
}