fix: request onerror

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-09 11:44:24 +08:00
parent e8396bd313
commit d4e33c9636

View File

@@ -44,12 +44,13 @@ class ApiInterceptor extends Interceptor {
// handler.next(err);
String url = err.requestOptions.uri.toString();
debugPrint('🌹🌹ApiInterceptor: $url');
// 屏蔽弹幕、心跳、人数请求的错误提示
if (!url.contains('heartbeat') &&
!url.contains('seg.so') &&
!url.contains('online/total') &&
!url.contains('github') &&
(!url.contains('skipSegments') && err.requestOptions.method != 'GET')) {
if (url.contains('heartbeat') ||
url.contains('seg.so') ||
url.contains('online/total') ||
url.contains('github') ||
(url.contains('skipSegments') && err.requestOptions.method == 'GET')) {
// skip
} else {
SmartDialog.showToast(
await dioError(err) + url,
displayType: SmartToastType.onlyRefresh,