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);