Commit 226515d1 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 55b07e22
...@@ -507,32 +507,32 @@ public interface LoanService { ...@@ -507,32 +507,32 @@ public interface LoanService {
builder.interceptors().add(okHttpInterceptor); builder.interceptors().add(okHttpInterceptor);
Retrofit retrofit; Retrofit retrofit;
if (BuildConfig.DEBUG) { // if (BuildConfig.DEBUG) {
SPUtil spUtil = SPUtil.getInstance(context); // SPUtil spUtil = SPUtil.getInstance(context);
if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) { // if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) {
spUtil.putString(Constant.LOCAL_IP, "http://39.106.5.102:9082/gs-api/"); // spUtil.putString(Constant.LOCAL_IP, "http://39.106.5.102:9082/gs-api/");
} // }
retrofit = new Retrofit.Builder() // retrofit = new Retrofit.Builder()
.client(builder.build()) // .client(builder.build())
.baseUrl(spUtil.getString(Constant.LOCAL_IP)) // .baseUrl(spUtil.getString(Constant.LOCAL_IP))
.addConverterFactory(GsonConverterFactory.create()) // .addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) // .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build(); // .build();
} else { // } else {
retrofit = new Retrofit.Builder() // retrofit = new Retrofit.Builder()
.client(builder.build()) // .client(builder.build())
.baseUrl(BuildConfig.MainIp) // .baseUrl(BuildConfig.MainIp)
.addConverterFactory(GsonConverterFactory.create()) // .addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) // .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build(); // .build();
} // }
// retrofit = new Retrofit.Builder() retrofit = new Retrofit.Builder()
// .client(builder.build()) .client(builder.build())
// .baseUrl(BuildConfig.MainIp) .baseUrl(BuildConfig.MainIp)
// .addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build(); .build();
return retrofit.create(LoanService.class); return retrofit.create(LoanService.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment