diff --git a/lib/network/NetworkConfig.dart b/lib/network/NetworkConfig.dart index 4d97ade..1fa4679 100644 --- a/lib/network/NetworkConfig.dart +++ b/lib/network/NetworkConfig.dart @@ -1,5 +1,5 @@ class NetworkConfig { - static String ServerDomain_Online = BASE_URLS_TEST[SELECT_INDEX]; + static String ServerDomain_Online = BASE_URLS[SELECT_INDEX]; static String deviceID = ""; //设备ID static String systemVersion = ""; //设备ID diff --git a/lib/tools/home/home_model.dart b/lib/tools/home/home_model.dart index 07cd49c..705da41 100644 --- a/lib/tools/home/home_model.dart +++ b/lib/tools/home/home_model.dart @@ -49,13 +49,15 @@ class HomeModel { ///设备列表 Future odfPortsUnitType() async { + List list = []; RequestCenter.instance.requestGet(NetworkConfig.odfPortsUnitType, {}, (dataEntity) { if (dataEntity.code == 200) { List data = (dataEntity.data as List).map((e) => DeviceListBean.fromJson(e as Map)).toList(); - for (var element in data) { - NetworkConfig.diverItems.add("${element.dictValue}"); + list.add("${element.dictValue}"); } + + NetworkConfig.diverItems = list; } }, (errorEntity) { print("errorEntity==${errorEntity.msg}"); @@ -64,13 +66,14 @@ class HomeModel { ///业务类型 Future odfPortsBusinessType() async { + List list = []; RequestCenter.instance.requestGet(NetworkConfig.odfPortsBusinessType, {}, (dataEntity) { if (dataEntity.code == 200) { List data = (dataEntity.data as List).map((e) => DeviceListBean.fromJson(e as Map)).toList(); - for (var element in data) { - NetworkConfig.businessItems.add("${element.dictValue}"); + list.add("${element.dictValue}"); } + NetworkConfig.businessItems = list; } }, (errorEntity) { print("errorEntity==${errorEntity.msg}");