From cdf598af659077f5f5f9d3090a7f81b7a2180704 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 17 May 2022 17:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E9=80=89=E6=8B=A9=E4=BD=8D?= =?UTF-8?q?=E7=BD=AEnull=E8=A7=A3=E5=86=B3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/login/login_page.dart | 3 ++- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/retrofit/retrofit_api.g.dart | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 490debd7..dd55456d 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -343,7 +343,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { EasyLoading.dismiss(); } else { - // SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); + if(value?.msg !=null) + SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); } }); } diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index cc2cfcbc..623d8cb2 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -102,7 +102,7 @@ abstract class MinApiService { } } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { ///高德地图的poi服务请求不需要toast - SmartDialog.showToast(map["msg"], alignment: Alignment.center); + // SmartDialog.showToast(map["msg"], alignment: Alignment.center); } debugPrint( "======================= Min_响应数据结束 =======================\n"); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 252cd821..cdc46026 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -130,7 +130,7 @@ abstract class ApiService { } } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { ///高德地图的poi服务请求不需要toast - SmartDialog.showToast(map["msg"], alignment: Alignment.center); + // SmartDialog.showToast(map["msg"], alignment: Alignment.center); } debugPrint("======================= 响应数据结束 =======================\n"); }, onError: (DioError e) { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index ac8c7fa4..f161e0ee 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -92,7 +92,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => LoginInfo.fromJson(json), + (json) => json==""?null :LoginInfo.fromJson(json), ); return value; }