alroyso 1 year ago
parent
commit
a2a05dfa55
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/app/network/dio_client.dart

+ 1 - 1
lib/app/network/dio_client.dart

@@ -111,7 +111,7 @@ class CustomInterceptors extends Interceptor {
       // 无网络连接,设置友好的错误消息
       err.error = AppException(message: "当前网络不可用,请检查您的网络");
       return handler.next(err);
-    } else if (err.error is SocketException || err.type == DioErrorType.other) {
+    } else if (err.error is SocketException || err.error is DioError) {
       if (_retryCount < _backupUrls.length) {
         // 有网络连接但请求失败,尝试使用备用地址
         err.requestOptions.baseUrl = _backupUrls[_retryCount];