1:添加备用服务器,在请求themeData的时候,返回的不对的时候,就切换服务器
This commit is contained in:
@@ -61,9 +61,9 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||
|
||||
public class RetrofitClient {
|
||||
|
||||
private static RetrofitClient INSTANCE;
|
||||
public static RetrofitClient INSTANCE;
|
||||
private static ApiServer sApiServer;
|
||||
public static final int DEFAULT_TIME_OUT = 30;
|
||||
public static final int DEFAULT_TIME_OUT = 10;
|
||||
private static OkHttpClient client;
|
||||
private final Retrofit mRetrofit;
|
||||
|
||||
@@ -1695,10 +1695,11 @@ public class RetrofitClient {
|
||||
observer.onNext(baseModel.getData());
|
||||
}
|
||||
} else {
|
||||
observer.onNext(null);
|
||||
CommonAppContext.getInstance().dialogHttp();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CommonAppContext.getInstance().dialogHttp();
|
||||
LogUtils.e("获取主题数据失败", response.message());
|
||||
}
|
||||
}
|
||||
@@ -1706,6 +1707,7 @@ public class RetrofitClient {
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<ThemeBean>> call, Throwable t) {
|
||||
LogUtils.e("获取主题数据失败", t);
|
||||
CommonAppContext.getInstance().dialogHttp();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user