|
|
|
@@ -15,27 +15,20 @@ import me.chanjar.weixin.common.util.DataUtils; |
|
|
|
import me.chanjar.weixin.common.util.http.*; |
|
|
|
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder; |
|
|
|
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder; |
|
|
|
import me.chanjar.weixin.common.util.json.WxGsonBuilder; |
|
|
|
import org.apache.http.Consts; |
|
|
|
import org.apache.http.HttpEntity; |
|
|
|
import org.apache.http.HttpHost; |
|
|
|
import org.apache.http.client.config.RequestConfig; |
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse; |
|
|
|
import org.apache.http.client.methods.HttpPost; |
|
|
|
import org.apache.http.entity.ContentType; |
|
|
|
import org.apache.http.entity.StringEntity; |
|
|
|
import org.apache.http.entity.mime.MultipartEntityBuilder; |
|
|
|
import org.apache.http.impl.client.BasicResponseHandler; |
|
|
|
import org.apache.http.impl.client.CloseableHttpClient; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.nio.charset.Charset; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.locks.Lock; |
|
|
|
|
|
|
|
import static cn.binarywang.wx.miniapp.constant.WxMaConstants.ErrorCode.*; |
|
|
|
import static com.iformall.douyin.web.config.TtWebConstants.ErrorCode.*; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @author |
|
|
|
@@ -242,9 +235,7 @@ public class TtWebServiceImpl implements TtWebService, RequestHttp<CloseableHttp |
|
|
|
/* |
|
|
|
* 发生以下情况时尝试刷新access_token |
|
|
|
*/ |
|
|
|
if (error.getErrorCode() == ERR_40001 |
|
|
|
|| error.getErrorCode() == ERR_42001 |
|
|
|
|| error.getErrorCode() == ERR_40014) { |
|
|
|
if (error.getErrorCode() == ERR_200104) { |
|
|
|
// 强制设置WxMaConfig的access token过期了,这样在下一次请求里就会刷新access token |
|
|
|
this.getTtWebConfig().expireAccessToken(); |
|
|
|
if (this.getTtWebConfig().autoRefreshToken()) { |
|
|
|
|