From b7bed99643b23f9c0a9bda909c18be1095ed0eec Mon Sep 17 00:00:00 2001 From: guozhigq Date: Wed, 20 Mar 2024 23:21:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/interceptor.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/http/interceptor.dart b/lib/http/interceptor.dart index 727d3e8fa..4b4d4bd1c 100644 --- a/lib/http/interceptor.dart +++ b/lib/http/interceptor.dart @@ -45,11 +45,15 @@ class ApiInterceptor extends Interceptor { void onError(DioException err, ErrorInterceptorHandler handler) async { // 处理网络请求错误 // handler.next(err); - SmartDialog.showToast( - await dioError(err), - displayType: SmartToastType.onlyRefresh, - displayTime: const Duration(seconds: 1), - ); + String url = err.requestOptions.uri.toString(); + print('🌹🌹ApiInterceptor: $url'); + if (!url.contains('heartbeat')) { + SmartDialog.showToast( + await dioError(err), + displayType: SmartToastType.onlyRefresh, + displayTime: const Duration(milliseconds: 1500), + ); + } super.onError(err, handler); }