From 2b322173f0f3481af85a614f2d01121b3638bed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Fri, 19 Mar 2021 14:23:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util/net_util.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/util/net_util.dart b/lib/util/net_util.dart index 642fc60..8243d4f 100644 --- a/lib/util/net_util.dart +++ b/lib/util/net_util.dart @@ -170,9 +170,12 @@ class NetUtil { ///非法用户 if (result[GlobalConfig.HTTP_RESPONSE_KEY_CODE]?.toString() == '401000') { try { - Future.delayed(Duration(seconds: 0)).then((onValue) { - BuildContext context = navigatorKey.currentState.overlay.context; - Provider.of(context, listen: false).unLogin(); + Future.delayed(Duration(seconds: 0)).then((onValue) async { + String token= await SharedPreferencesUtil.getStringValue(GlobalConfig.SHARED_KEY_TOKEN); + if(token!=null&&token.length>2){ + BuildContext context = navigatorKey.currentState.overlay.context; + Provider.of(context, listen: false).unLogin(); + } }); } catch (e, s) { Logger.error(e, s);