|
@@ -3,6 +3,7 @@ package com.fdkk.sxz.util;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkk.sxz.Interceptor.OkHttpLogInterceptor;
|
|
|
import okhttp3.*;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -47,6 +48,7 @@ public class OkHttpUtils {
|
|
|
clientBuilder.writeTimeout(OkHttpUtils.WRITE_TIMEOUT, TimeUnit.MINUTES);
|
|
|
//自定义连接池最大空闲连接数和等待时间大小,否则默认最大5个空闲连接
|
|
|
clientBuilder.connectionPool(new ConnectionPool(32, 30, TimeUnit.MINUTES));
|
|
|
+ clientBuilder.addInterceptor(new OkHttpLogInterceptor(3));
|
|
|
OkHttpUtils.okHttpClient = clientBuilder.build();
|
|
|
}
|
|
|
|