web优化

This commit is contained in:
18631081161 2025-09-26 00:12:48 +08:00
parent d884436dcf
commit 1c0ebd3e64
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,5 @@
class NetworkConfig { 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 deviceID = ""; //ID
static String systemVersion = ""; //ID static String systemVersion = ""; //ID

View File

@ -49,13 +49,15 @@ class HomeModel {
/// ///
Future<void> odfPortsUnitType() async { Future<void> odfPortsUnitType() async {
List<String> list = [];
RequestCenter.instance.requestGet(NetworkConfig.odfPortsUnitType, {}, (dataEntity) { RequestCenter.instance.requestGet(NetworkConfig.odfPortsUnitType, {}, (dataEntity) {
if (dataEntity.code == 200) { if (dataEntity.code == 200) {
List<DeviceListBean> data = (dataEntity.data as List<dynamic>).map((e) => DeviceListBean.fromJson(e as Map<String, dynamic>)).toList(); List<DeviceListBean> data = (dataEntity.data as List<dynamic>).map((e) => DeviceListBean.fromJson(e as Map<String, dynamic>)).toList();
for (var element in data) { for (var element in data) {
NetworkConfig.diverItems.add("${element.dictValue}"); list.add("${element.dictValue}");
} }
NetworkConfig.diverItems = list;
} }
}, (errorEntity) { }, (errorEntity) {
print("errorEntity==${errorEntity.msg}"); print("errorEntity==${errorEntity.msg}");
@ -64,13 +66,14 @@ class HomeModel {
/// ///
Future<void> odfPortsBusinessType() async { Future<void> odfPortsBusinessType() async {
List<String> list = [];
RequestCenter.instance.requestGet(NetworkConfig.odfPortsBusinessType, {}, (dataEntity) { RequestCenter.instance.requestGet(NetworkConfig.odfPortsBusinessType, {}, (dataEntity) {
if (dataEntity.code == 200) { if (dataEntity.code == 200) {
List<DeviceListBean> data = (dataEntity.data as List<dynamic>).map((e) => DeviceListBean.fromJson(e as Map<String, dynamic>)).toList(); List<DeviceListBean> data = (dataEntity.data as List<dynamic>).map((e) => DeviceListBean.fromJson(e as Map<String, dynamic>)).toList();
for (var element in data) { for (var element in data) {
NetworkConfig.businessItems.add("${element.dictValue}"); list.add("${element.dictValue}");
} }
NetworkConfig.businessItems = list;
} }
}, (errorEntity) { }, (errorEntity) {
print("errorEntity==${errorEntity.msg}"); print("errorEntity==${errorEntity.msg}");