提交 127afa14 authored 作者: 张国庆's avatar 张国庆

修改 请求出错打印文件内容
上级 9409af6f
...@@ -11,7 +11,7 @@ export 'package:dio/io.dart'; ...@@ -11,7 +11,7 @@ export 'package:dio/io.dart';
abstract class BaseDio { abstract class BaseDio {
final dio = Dio( final dio = Dio(
BaseOptions( BaseOptions(
connectTimeout: const Duration(seconds: 5), connectTimeout: const Duration(seconds: 10),
receiveTimeout: const Duration(seconds: 10), receiveTimeout: const Duration(seconds: 10),
contentType: Headers.jsonContentType, contentType: Headers.jsonContentType,
// Transform the response data to a String encoded with UTF8. // Transform the response data to a String encoded with UTF8.
...@@ -100,7 +100,7 @@ abstract class BaseDio { ...@@ -100,7 +100,7 @@ abstract class BaseDio {
"请求错误:${e.response!.statusCode} ${e.response!.requestOptions.path}"); "请求错误:${e.response!.statusCode} ${e.response!.requestOptions.path}");
} else { } else {
// Something happened in setting up or sending the request that triggered an Error // Something happened in setting up or sending the request that triggered an Error
logger.e("请求错误:${e.message}"); logger.e("请求错误:${e.error}");
} }
errorCallback?.call(500, "服务器请求错误"); errorCallback?.call(500, "服务器请求错误");
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论