From 1c0ebd3e64b88a1438530b8d69059097764993a7 Mon Sep 17 00:00:00 2001 From: 18631081161 <2088094923@qq.com> Date: Fri, 26 Sep 2025 00:12:48 +0800 Subject: [PATCH] =?UTF-8?q?web=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/network/NetworkConfig.dart | 2 +- lib/tools/home/home_model.dart | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) 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}");