22
33import android .text .TextUtils ;
44
5- import com .common .base .BaseApplication ;
6- import com .common .data .InfoCache ;
7- import com .common .util .NetworkUtils ;
8- import com .common .util .StringUtils ;
9- import com .common .util .ToastUtils ;
105import com .franmontiel .persistentcookiejar .ClearableCookieJar ;
116import com .franmontiel .persistentcookiejar .PersistentCookieJar ;
127import com .franmontiel .persistentcookiejar .cache .SetCookieCache ;
138import com .franmontiel .persistentcookiejar .persistence .SharedPrefsCookiePersistor ;
14- import com .hikvision .isms .petrel .common .R ;
9+ import com .guiying .common .R ;
10+ import com .guiying .common .utils .NetworkUtils ;
11+ import com .guiying .common .utils .StringUtils ;
12+ import com .guiying .common .utils .ToastUtils ;
13+ import com .guiying .common .utils .Utils ;
1514import com .orhanobut .logger .Logger ;
1615
1716import java .io .IOException ;
@@ -48,7 +47,7 @@ public class HttpClient {
4847 /*返回数据为xml类型*/
4948 public static final int XML = 3 ;
5049 /*用户设置的BASE_URL*/
51- public static String BASE_URL = InfoCache . getIns (). getBaseUrl () ;
50+ public static String BASE_URL = "" ;
5251 /*本地使用的baseUrl*/
5352 private String baseUrl = "" ;
5453 private static OkHttpClient okHttpClient ;
@@ -74,11 +73,11 @@ private static class HttpClientHolder {
7473 }
7574
7675 private HttpClient () {
77- ClearableCookieJar cookieJar = new PersistentCookieJar (new SetCookieCache (), new SharedPrefsCookiePersistor (BaseApplication . getIns ()));
78- //HttpsUtil.SSLParams sslParams = HttpsUtil.getSslSocketFactory(BaseApplication.context, new int[0], R.raw.ivms8700, STORE_PASS );
76+ ClearableCookieJar cookieJar = new PersistentCookieJar (new SetCookieCache (), new SharedPrefsCookiePersistor (Utils . getContext ()));
77+ //HttpsUtil.SSLParams sslParams = HttpsUtil.getSslSocketFactory(BaseApplication.context, new int[0], , );
7978 okHttpClient = new OkHttpClient .Builder ()
8079 .connectTimeout (10000L , TimeUnit .MILLISECONDS )
81- .sslSocketFactory (sslParams .sSLSocketFactory , sslParams .trustManager )
80+ // .sslSocketFactory(sslParams.sSLSocketFactory, sslParams.trustManager)
8281 .hostnameVerifier (HttpsUtil .getHostnameVerifier ())
8382 .addInterceptor (new LoggerInterceptor (null , true ))
8483 .cookieJar (cookieJar )
@@ -245,10 +244,10 @@ public Builder() {
245244 }
246245
247246 /**
248- * 如需设置baseUrl请使用这种方法:HttpClient.BASE_URL = "https ://10.33.31.200:8890 /";
247+ * 如需设置baseUrl请使用这种方法:HttpClient.BASE_URL = "http ://000000000000 /";
249248 * 不推荐使用下面的方法改变baseUrl的值。
250249 * 请求地址的baseUrl,最后会被赋值给HttpClient的静态变量BASE_URL;
251- * 例如:"https://10.33.31.200:8890 /"
250+ * 例如:"https://00000000000 /"
252251 *
253252 * @param baseUrl 请求地址的baseUrl
254253 */
@@ -327,7 +326,7 @@ private void parseJson(String data, Class clazz, int bodyType, OnResultListener
327326 onResultListener .onSuccess (DataParseUtil .parseToArrayList (data , clazz ));
328327 break ;
329328 case XML :
330- onResultListener .onSuccess (DataParseUtil .parseXml (data , clazz ));
329+ // onResultListener.onSuccess(DataParseUtil.parseXml(data, clazz));
331330 break ;
332331 default :
333332 Logger .e ("http parse tip:" , "if you want return object, please use bodyType() set data type" );
0 commit comments