From edbacc502ba41b2e20c9b55bc1f90c4caf6fa4f4 Mon Sep 17 00:00:00 2001 From: userGyl Date: Fri, 16 Jan 2026 17:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E5=9F=9F=E5=90=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ln_jq_app/lib/common/styles/theme.dart | 4 ++-- ln_jq_app/lib/main.dart | 7 +++++-- ln_jq_app/lib/pages/login/view.dart | 26 +++++++++++++++----------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ln_jq_app/lib/common/styles/theme.dart b/ln_jq_app/lib/common/styles/theme.dart index 767c678..20992cd 100644 --- a/ln_jq_app/lib/common/styles/theme.dart +++ b/ln_jq_app/lib/common/styles/theme.dart @@ -8,11 +8,11 @@ class AppTheme { static const Color themeColor = Color(0xFF0c83c3); //是否开放域名切换 - static const bool is_show_host = true; + static const bool is_show_host = false; //http://192.168.110.222:8080/ //http://192.168.110.44:8080/ - static String test_service_url = "https://beta-esg.api.lnh2e.com/"; + static String test_service_url = "http://47.101.201.13:8443/api/"; static const String release_service_url = ""; //加氢站相关查询 diff --git a/ln_jq_app/lib/main.dart b/ln_jq_app/lib/main.dart index 1a5f1d1..6237ac5 100644 --- a/ln_jq_app/lib/main.dart +++ b/ln_jq_app/lib/main.dart @@ -15,7 +15,7 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); WidgetsBinding widgetsBinding = await init( - isDebug: true, + isDebug: false, logTag: '小羚羚', supportedLocales: [Locale('zh', 'CN')], ); @@ -31,7 +31,7 @@ void main() async { // 设计稿尺寸 单位:dp designSize: const Size(390, 844), // Getx Log - enableLog: true, + enableLog: false, // 默认的跳转动画 defaultTransition: Transition.rightToLeft, // 主题模式 @@ -74,6 +74,9 @@ void initHttpSet() { // 设置全局响应处理器 HttpService.to.setOnResponseHandler((response) async { try { + if (response.data == null) { + return '服务繁忙,稍后重试'; + } final baseModel = BaseModel.fromJson(response.data); if (baseModel.code == 0 || baseModel.code == 200) { diff --git a/ln_jq_app/lib/pages/login/view.dart b/ln_jq_app/lib/pages/login/view.dart index 37d6f8f..55e59a9 100644 --- a/ln_jq_app/lib/pages/login/view.dart +++ b/ln_jq_app/lib/pages/login/view.dart @@ -208,18 +208,22 @@ class _LoginPageState extends State with SingleTickerProviderStateMix addAlias(phone); //登录后查询已绑定车辆信息 - var carInfo = await HttpService.to.get( - "appointment/driver/getTruckInfoByDriver?phone=$phone", - ); - if (carInfo != null) { - var carInforesult = BaseModel.fromJson(carInfo.data); - if (carInforesult.data != null) { - final vehicle = VehicleInfo.fromJson( - carInforesult.data as Map, - ); - //保存使用 - await StorageService.to.saveVehicleInfo(vehicle); + try { + var carInfo = await HttpService.to.get( + "appointment/driver/getTruckInfoByDriver?phone=$phone", + ); + if (carInfo != null) { + var carInforesult = BaseModel.fromJson(carInfo.data); + if (carInforesult.data != null) { + final vehicle = VehicleInfo.fromJson( + carInforesult.data as Map, + ); + //保存使用 + await StorageService.to.saveVehicleInfo(vehicle); + } } + } catch (e) { + Logger.d("暂时不处理 查询车辆信息失败的情况"); } //页面操作