mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 10:38:42 +08:00 
			
		
		
		
	| @ -158,7 +158,7 @@ public class WxMpServiceImpl implements WxMpService { | |||||||
|               RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build(); |               RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build(); | ||||||
|               httpGet.setConfig(config); |               httpGet.setConfig(config); | ||||||
|             } |             } | ||||||
|             CloseableHttpResponse response = getHttpclient().execute(httpGet); |             try (CloseableHttpResponse response = getHttpclient().execute(httpGet)) { | ||||||
|               String resultContent = new BasicResponseHandler().handleResponse(response); |               String resultContent = new BasicResponseHandler().handleResponse(response); | ||||||
|               WxError error = WxError.fromJson(resultContent); |               WxError error = WxError.fromJson(resultContent); | ||||||
|               if (error.getErrorCode() != 0) { |               if (error.getErrorCode() != 0) { | ||||||
| @ -166,6 +166,7 @@ public class WxMpServiceImpl implements WxMpService { | |||||||
|               } |               } | ||||||
|               WxAccessToken accessToken = WxAccessToken.fromJson(resultContent); |               WxAccessToken accessToken = WxAccessToken.fromJson(resultContent); | ||||||
|               wxMpConfigStorage.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn()); |               wxMpConfigStorage.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn()); | ||||||
|  |             } | ||||||
|           } catch (ClientProtocolException e) { |           } catch (ClientProtocolException e) { | ||||||
|             throw new RuntimeException(e); |             throw new RuntimeException(e); | ||||||
|           } catch (IOException e) { |           } catch (IOException e) { | ||||||
| @ -851,8 +852,7 @@ public class WxMpServiceImpl implements WxMpService { | |||||||
|  |  | ||||||
|     StringEntity entity = new StringEntity(request.toString(), Consts.UTF_8); |     StringEntity entity = new StringEntity(request.toString(), Consts.UTF_8); | ||||||
|     httpPost.setEntity(entity); |     httpPost.setEntity(entity); | ||||||
|     try { |     try(CloseableHttpResponse response = getHttpclient().execute(httpPost)) { | ||||||
|       CloseableHttpResponse response = getHttpclient().execute(httpPost); |  | ||||||
|       String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); |       String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); | ||||||
|       XStream xstream = XStreamInitializer.getInstance(); |       XStream xstream = XStreamInitializer.getInstance(); | ||||||
|       xstream.alias("xml", WxMpPrepayIdResult.class); |       xstream.alias("xml", WxMpPrepayIdResult.class); | ||||||
| @ -944,8 +944,7 @@ public class WxMpServiceImpl implements WxMpService { | |||||||
|  |  | ||||||
|     StringEntity entity = new StringEntity(request.toString(), Consts.UTF_8); |     StringEntity entity = new StringEntity(request.toString(), Consts.UTF_8); | ||||||
|     httpPost.setEntity(entity); |     httpPost.setEntity(entity); | ||||||
|     try { |     try(CloseableHttpResponse response = httpClient.execute(httpPost)) { | ||||||
|       CloseableHttpResponse response = httpClient.execute(httpPost); |  | ||||||
|       String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); |       String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); | ||||||
|       XStream xstream = XStreamInitializer.getInstance(); |       XStream xstream = XStreamInitializer.getInstance(); | ||||||
|       xstream.alias("xml", WxMpPayResult.class); |       xstream.alias("xml", WxMpPayResult.class); | ||||||
| @ -1000,8 +999,7 @@ public class WxMpServiceImpl implements WxMpService { | |||||||
|  |  | ||||||
|     StringEntity entity = new StringEntity(request.toString(), Consts.UTF_8); |     StringEntity entity = new StringEntity(request.toString(), Consts.UTF_8); | ||||||
|     httpPost.setEntity(entity); |     httpPost.setEntity(entity); | ||||||
|     try { |     try(CloseableHttpResponse response = getHttpclient().execute(httpPost)) { | ||||||
|       CloseableHttpResponse response = getHttpclient().execute(httpPost); |  | ||||||
|       String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); |       String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); | ||||||
|       XStream xstream = XStreamInitializer.getInstance(); |       XStream xstream = XStreamInitializer.getInstance(); | ||||||
|       xstream.processAnnotations(WxRedpackResult.class); |       xstream.processAnnotations(WxRedpackResult.class); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Daniel Qian
					Daniel Qian