|
@@ -2,6 +2,7 @@ package com.kuxuan.laraver.net;
|
2
|
2
|
|
3
|
3
|
import com.kuxuan.laraver.app.ConfigKeys;
|
4
|
4
|
import com.kuxuan.laraver.app.Laraver;
|
|
5
|
+import com.kuxuan.laraver.net.interceptors.ReleaseInterceptor;
|
5
|
6
|
import com.kuxuan.laraver.net.rx.RxRestService;
|
6
|
7
|
|
7
|
8
|
import java.util.ArrayList;
|
|
@@ -38,7 +39,17 @@ public final class RestCreator {
|
38
|
39
|
private static final class OKHttpHolder {
|
39
|
40
|
private static final int TIME_OUT = 60;
|
40
|
41
|
private static final OkHttpClient.Builder BUILDER = new OkHttpClient.Builder();
|
41
|
|
- private static final ArrayList<Interceptor> INTERCEPTORS = Laraver.getConfiguration(ConfigKeys.INTERCEPTOR);
|
|
42
|
+ //private static final ArrayList<Interceptor> INTERCEPTORS = Laraver.getConfiguration(ConfigKeys.INTERCEPTOR);
|
|
43
|
+ private static ArrayList<Interceptor> INTERCEPTORS =null;
|
|
44
|
+
|
|
45
|
+ {
|
|
46
|
+ if(Laraver.getConfiguration(ConfigKeys.INTERCEPTOR)!=null){
|
|
47
|
+ INTERCEPTORS = Laraver.getConfiguration(ConfigKeys.INTERCEPTOR);
|
|
48
|
+ }else{
|
|
49
|
+ INTERCEPTORS = new ArrayList<>();
|
|
50
|
+ INTERCEPTORS.add(new ReleaseInterceptor());
|
|
51
|
+ }
|
|
52
|
+ }
|
42
|
53
|
|
43
|
54
|
private static OkHttpClient.Builder addInterceptor() {
|
44
|
55
|
if (INTERCEPTORS != null && !INTERCEPTORS.isEmpty()) {
|