瀏覽代碼

1.优化首页重启的问题

tags/0.0.8+2
“yanghuaxuan” 4 年之前
父節點
當前提交
2b322173f0
共有 1 個檔案被更改,包括 6 行新增3 行删除
  1. +6
    -3
      lib/util/net_util.dart

+ 6
- 3
lib/util/net_util.dart 查看文件

@@ -170,9 +170,12 @@ class NetUtil {
///非法用户 ///非法用户
if (result[GlobalConfig.HTTP_RESPONSE_KEY_CODE]?.toString() == '401000') { if (result[GlobalConfig.HTTP_RESPONSE_KEY_CODE]?.toString() == '401000') {
try { try {
Future.delayed(Duration(seconds: 0)).then((onValue) { Future.delayed(Duration(seconds: 0)).then((onValue) async {
BuildContext context = navigatorKey.currentState.overlay.context; String token= await SharedPreferencesUtil.getStringValue(GlobalConfig.SHARED_KEY_TOKEN);
Provider.of<UserInfoNotifier>(context, listen: false).unLogin(); if(token!=null&&token.length>2){
BuildContext context = navigatorKey.currentState.overlay.context;
Provider.of<UserInfoNotifier>(context, listen: false).unLogin();
}
}); });
} catch (e, s) { } catch (e, s) {
Logger.error(e, s); Logger.error(e, s);


||||||
x
 
000:0
Loading…
取消
儲存