@@ -18,7 +18,7 @@ class LogsInterceptors extends InterceptorsWrapper {
1818 static List <String ?> sHttpErrorUrl = [];
1919
2020 @override
21- onRequest (RequestOptions options) async {
21+ onRequest (RequestOptions options, handler ) async {
2222 if (Config .DEBUG ! ) {
2323 print ("请求url:${options .path } ${options .method }" );
2424 options.headers.forEach ((k, v) => options.headers[k] = v ?? "" );
@@ -45,19 +45,19 @@ class LogsInterceptors extends InterceptorsWrapper {
4545 } catch (e) {
4646 print (e);
4747 }
48- return options;
48+ return super . onRequest ( options, handler) ;
4949 }
5050
5151 @override
52- onResponse (Response response) async {
52+ onResponse (Response response, handler ) async {
5353 if (Config .DEBUG ! ) {
54- print ('返回参数: ' + response.toString ());
54+ print ('返回参数: ' + response.toString ());
5555 }
5656 if (response.data is Map || response.data is List ) {
5757 try {
5858 var data = Map <String , dynamic >();
5959 data["data" ] = response.data;
60- addLogic (sResponsesHttpUrl, response.request .uri.toString ());
60+ addLogic (sResponsesHttpUrl, response.requestOptions .uri.toString ());
6161 addLogic (sHttpResponses, data);
6262 } catch (e) {
6363 print (e);
@@ -66,38 +66,38 @@ class LogsInterceptors extends InterceptorsWrapper {
6666 try {
6767 var data = Map <String , dynamic >();
6868 data["data" ] = response.data;
69- addLogic (sResponsesHttpUrl, response.request .uri.toString () );
69+ addLogic (sResponsesHttpUrl, response.requestOptions .uri.toString ());
7070 addLogic (sHttpResponses, data);
7171 } catch (e) {
7272 print (e);
7373 }
7474 } else if (response.data != null ) {
7575 try {
7676 String data = response.data.toJson ();
77- addLogic (sResponsesHttpUrl, response.request .uri.toString () );
77+ addLogic (sResponsesHttpUrl, response.requestOptions .uri.toString ());
7878 addLogic (sHttpResponses, json.decode (data));
7979 } catch (e) {
8080 print (e);
8181 }
8282 }
83- return response; // continue
83+ return super . onResponse ( response, handler);
8484 }
8585
8686 @override
87- onError (DioError err) async {
87+ onError (DioError err, handler ) async {
8888 if (Config .DEBUG ! ) {
8989 print ('请求异常: ' + err.toString ());
9090 print ('请求异常信息: ' + (err.response? .toString () ?? "" ));
9191 }
9292 try {
93- addLogic (sHttpErrorUrl, err.request ! .path);
93+ addLogic (sHttpErrorUrl, err.requestOptions .path);
9494 var errors = Map <String , dynamic >();
9595 errors["error" ] = err.message;
9696 addLogic (sHttpError, errors);
9797 } catch (e) {
9898 print (e);
9999 }
100- return err; // continue ;
100+ return super . onError ( err, handler) ;
101101 }
102102
103103 static addLogic (List list, data) {
0 commit comments