diff --git a/lib/http/interceptor.dart b/lib/http/interceptor.dart index 727d3e8f..4b4d4bd1 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); }