Browse Source

更新网络错误提示

tags/0.0.1
Weller 4 years ago
parent
commit
5b36124cd5
1 changed files with 11 additions and 14 deletions
  1. +11
    -14
      lib/util/net_util.dart

+ 11
- 14
lib/util/net_util.dart View File

@@ -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])


Loading…
Cancel
Save