From cc0cbfc79a34e1b106fdb998450cd2ad03446126 Mon Sep 17 00:00:00 2001
From: Administrator <hbal>
Date: 星期五, 14 四月 2023 08:35:13 +0800
Subject: [PATCH] 明晟分屏展示

---
 JavaSource/com/mandi/common/Wxhtmethod.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/JavaSource/com/mandi/common/Wxhtmethod.java b/JavaSource/com/mandi/common/Wxhtmethod.java
index 3023f90..422be13 100644
--- a/JavaSource/com/mandi/common/Wxhtmethod.java
+++ b/JavaSource/com/mandi/common/Wxhtmethod.java
@@ -12,6 +12,7 @@
 
 import org.apache.http.HttpEntity;
 import org.apache.http.NameValuePair;
+import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
@@ -112,6 +113,8 @@
 		 JsonObject jo=new JsonObject();
 		 CloseableHttpClient httpclient = HttpClients.createDefault();
 		 HttpPost hp=new HttpPost(url);
+		RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build();
+		hp.setConfig(config);
 		 String re=null;
 		 List<NameValuePair> fps=new ArrayList<NameValuePair>();
 		 UrlEncodedFormEntity entity=null;
@@ -176,6 +179,8 @@
 //			 s.setContentEncoding("UTF-8");
 //			 hp.setEntity(s);
 			 HttpPost hp=new HttpPost(url);
+			 RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build();
+			 hp.setConfig(config);
 			 StringEntity se=new StringEntity(jsonStr, Charset.forName("utf-8"));
 			 se.setContentType("application/json");
 			 hp.setEntity(se);
@@ -276,6 +281,8 @@
 	{
 		 CloseableHttpClient httpclient = HttpClients.createDefault();
 		 HttpPost hp=new HttpPost(url);
+		RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build();
+		hp.setConfig(config);
 		 String re=null;
 		 List<NameValuePair> fps=new ArrayList<NameValuePair>();
 		 UrlEncodedFormEntity entity=null;
@@ -314,6 +321,8 @@
 		 CloseableHttpClient httpclient=nssl();
 		// CloseableHttpClient httpclient = HttpClients.createDefault();
 		 HttpPost hp=new HttpPost(url);
+		RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build();
+		hp.setConfig(config);
 		 String re=null;
 		 List<NameValuePair> fps=new ArrayList<NameValuePair>();
 		 UrlEncodedFormEntity entity=null;
@@ -352,6 +361,8 @@
 	{
 		 CloseableHttpClient httpclient=nssl();
 		 HttpPost hp=new HttpPost(url);
+		RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build();
+		hp.setConfig(config);
 		 MultipartEntityBuilder me=MultipartEntityBuilder.create();
 		 me.addBinaryBody(upfilename, file);
 		 if(params!=null)
@@ -386,6 +397,8 @@
 	{
 		 CloseableHttpClient httpclient=nssl();
 		 HttpPost hp=new HttpPost(url);
+		RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build();
+		hp.setConfig(config);
 		 StringEntity se=new StringEntity(body, Charset.forName("utf-8"));
 		 hp.setEntity(se);
 		 String re=null;

--
Gitblit v1.9.3