From 5b36124cd5b04e81cf837ca52ebff4f09a06b623 Mon Sep 17 00:00:00 2001 From: Weller <1812208341@qq.com> Date: Fri, 16 Oct 2020 18:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BD=91=E7=BB=9C=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util/net_util.dart | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/util/net_util.dart b/lib/util/net_util.dart index f12d3ea..895330b 100644 --- a/lib/util/net_util.dart +++ b/lib/util/net_util.dart @@ -126,15 +126,18 @@ class NetUtil { } return result; // 缓存返回的数据 - } + } else { + Logger.error('error: ' + result[GlobalConfig.HTTP_RESPONSE_KEY_MSG]); + if (result[GlobalConfig.HTTP_RESPONSE_KEY_CODE] != 401000) { + Fluttertoast.showToast( + msg: result[GlobalConfig.HTTP_RESPONSE_KEY_MSG], + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.BOTTOM, + ); + } - Logger.error('error: ' + result[GlobalConfig.HTTP_RESPONSE_KEY_MSG]); - Fluttertoast.showToast( - msg: result[GlobalConfig.HTTP_RESPONSE_KEY_MSG], - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.BOTTOM, - ); - return result; + return result; + } } catch (e) { return null; } @@ -168,12 +171,6 @@ class NetUtil { return; } - Logger.error('error: ' + result[GlobalConfig.HTTP_RESPONSE_KEY_MSG]); - Fluttertoast.showToast( - msg: result[GlobalConfig.HTTP_RESPONSE_KEY_MSG], - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.BOTTOM, - ); if (onError != null) { onError(!EmptyUtil.isEmpty(result) ? !EmptyUtil.isEmpty(result[GlobalConfig.HTTP_RESPONSE_KEY_MSG])