diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml
index b9e9a487..253d6492 100644
--- a/ruoyi-common/ruoyi-common-core/pom.xml
+++ b/ruoyi-common/ruoyi-common-core/pom.xml
@@ -121,7 +121,7 @@
org.apache.httpcomponents
httpclient
- 4.3.5
+ 4.5.11
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/listener/ConfigListener.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/listener/ConfigListener.java
new file mode 100644
index 00000000..ec66cac7
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/listener/ConfigListener.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ruoyi.common.core.listener;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * ServletContext监听器
+ *
+ * @author stylefeng
+ * @Date 2018/2/22 21:07
+ */
+public class ConfigListener implements ServletContextListener {
+
+ private static Map conf = new HashMap<>();
+
+ public static Map getConf() {
+ return conf;
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent arg0) {
+ conf.clear();
+ }
+
+ @Override
+ public void contextInitialized(ServletContextEvent evt) {
+ ServletContext sc = evt.getServletContext();
+
+ //项目发布,当前运行环境的绝对路径
+ conf.put("realPath", sc.getRealPath("/").replaceFirst("/", ""));
+
+ //servletContextPath,默认""
+ conf.put("contextPath", sc.getContextPath());
+
+ //微信证书路径
+ conf.put("certPath", sc.getRealPath("/static/cert/apiclient_cert.p12"));
+ }
+
+}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/HttpUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/HttpUtils.java
new file mode 100644
index 00000000..a6512016
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/HttpUtils.java
@@ -0,0 +1,409 @@
+package com.ruoyi.common.core.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+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;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.*;
+
+/**
+ * http相关操作
+ *
+ * @author fengjundan on 2018/5/12.
+ */
+public class HttpUtils {
+
+ /**
+ * 连接池管理
+ */
+ private static PoolingHttpClientConnectionManager poolConnManager = null;
+
+ private static Logger logger = LogManager.getLogger(HttpUtils.class);
+
+ private static CloseableHttpClient httpClient = null;
+ /**
+ * 请求器的配置
+ */
+ private static RequestConfig requestConfig;
+
+
+ static {
+ try {
+ System.out.println("httpClient~~~开始");
+ SSLContextBuilder builder = new SSLContextBuilder();
+ builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
+ SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build());
+ // 配置同时支持 HTTP 和 HTPPS
+ Registry socketFactoryRegistry = RegistryBuilder.create().register(
+ "http", PlainConnectionSocketFactory.getSocketFactory()).register(
+ "https", sslsf).build();
+ // 初始化连接管理器
+ poolConnManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
+ // 将最大连接数增加到200
+ poolConnManager.setMaxTotal(200);
+ // 设置最大路由
+ poolConnManager.setDefaultMaxPerRoute(2);
+ // 根据默认超时限制初始化requestConfig
+ int socketTimeout = 100000;
+ int connectTimeout = 100000;
+ int connectionRequestTimeout = 100000;
+ requestConfig = RequestConfig.custom().setConnectionRequestTimeout(
+ connectionRequestTimeout).setSocketTimeout(socketTimeout).setConnectTimeout(
+ connectTimeout).build();
+ // 初始化httpClient
+ httpClient = getConnection();
+ System.out.println("初始化HttpClient~~~结束");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static CloseableHttpClient getConnection() {
+ CloseableHttpClient closeableHttpClient = HttpClients.custom()
+ // 设置连接池管理
+ .setConnectionManager(poolConnManager)
+ // 设置请求配置
+ .setDefaultRequestConfig(requestConfig)
+ // 设置重试次数
+ .setRetryHandler(new DefaultHttpRequestRetryHandler(0, false))
+ .build();
+ return closeableHttpClient;
+ }
+
+
+ /**
+ * get请求
+ *
+ * @param url 请求地址
+ * @return
+ * @author fengjundan
+ * @date 2018/5/12
+ */
+ public static String get(String url) {
+ HttpGet httpGet = new HttpGet(url);
+ CloseableHttpResponse response = null;
+ try {
+ response = httpClient.execute(httpGet);
+ HttpEntity entity = response.getEntity();
+ String result = EntityUtils.toString(entity);
+ return result;
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ destroy(httpGet, response);
+ }
+ return null;
+ }
+
+ /**
+ * get请求(带header)
+ *
+ * @author fengjundan
+ * @date 2019/12/30 11:45
+ */
+ public static String get(String url, Map headers) {
+ HttpGet httpGet = new HttpGet(url);
+ CloseableHttpResponse response = null;
+ try {
+ if (headers != null && headers.size() > 0) {
+ for (String key : headers.keySet()) {
+ httpGet.setHeader(key, StringUtils.valueOf(headers.get(key)));
+ }
+ }
+ response = httpClient.execute(httpGet);
+ HttpEntity entity = response.getEntity();
+ String result = EntityUtils.toString(entity);
+ return result;
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ destroy(httpGet, response);
+ }
+ return null;
+ }
+
+
+ /**
+ * post请求
+ *
+ * @param url 请求地址
+ * @param params json格式的参数数据
+ * @return
+ * @author fengjundan
+ * @date 2018/6/2
+ */
+ public static String post(String url, String params) {
+ HttpPost httpPost = new HttpPost(url);
+ if (!StringUtils.isNull(params)) {
+ StringEntity stringEntity = new StringEntity(params, ContentType.APPLICATION_JSON);
+ httpPost.setEntity(stringEntity);
+ }
+ CloseableHttpResponse response = null;
+ try {
+ response = httpClient.execute(httpPost);
+ if (response != null && response.getStatusLine().getStatusCode() == 200) {
+ HttpEntity entity = response.getEntity();
+ String result = EntityUtils.toString(entity, "UTF-8");
+ return result;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ destroy(httpPost, response);
+ }
+ return null;
+ }
+
+ /**
+ * post body请求
+ *
+ * @param url 请求地址
+ * @param params json格式的参数数据
+ * @return
+ * @author fengjundan
+ * @date 2018/6/2
+ */
+ public static String postBody(String url, String params) {
+ HttpPost httpPost = new HttpPost(url);
+ if (!StringUtils.isNull(params)) {
+ StringEntity stringEntity = new StringEntity(params, ContentType.APPLICATION_JSON);
+ httpPost.setEntity(stringEntity);
+ }
+ CloseableHttpResponse response = null;
+ try {
+ httpPost.setHeader("Content-Type", "application/json");
+ response = httpClient.execute(httpPost);
+ if (response != null && response.getStatusLine().getStatusCode() == 200) {
+ HttpEntity entity = response.getEntity();
+ String result = EntityUtils.toString(entity, "UTF-8");
+ return result;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ destroy(httpPost, response);
+ }
+ return null;
+ }
+
+ /**
+ * post body请求 (带header)
+ *
+ * @author fengjundan
+ * @date 2019/12/30 10:10
+ */
+ public static String postBody(String url, String params, Map headers) {
+ HttpPost httpPost = new HttpPost(url);
+ if (!StringUtils.isNull(params)) {
+ StringEntity stringEntity = new StringEntity(params, ContentType.APPLICATION_JSON);
+ httpPost.setEntity(stringEntity);
+ }
+ CloseableHttpResponse response = null;
+ try {
+ if (headers != null && headers.size() > 0) {
+ for (String key : headers.keySet()) {
+ httpPost.setHeader(key, StringUtils.valueOf(headers.get(key)));
+ }
+ }
+ httpPost.setHeader("Content-Type", "application/json");
+ response = httpClient.execute(httpPost);
+ if (response != null && response.getStatusLine().getStatusCode() == 200) {
+ HttpEntity entity = response.getEntity();
+ String result = EntityUtils.toString(entity, "UTF-8");
+ return result;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ destroy(httpPost, response);
+ }
+ return null;
+ }
+
+ /**
+ * post body请求
+ *
+ * @param url 请求地址
+ * @param jsonObject json参数
+ * @return
+ * @author fengjundan
+ * @date 2018/6/28
+ */
+ public static String postBody(String url, JSONObject jsonObject) {
+ if (jsonObject == null) {
+ return null;
+ }
+ return postBody(url, jsonObject.toJSONString());
+ }
+
+
+ /**
+ * post请求
+ *
+ * @param url 请求地址
+ * @return
+ * @author fengjundan
+ * @date 2018/6/2
+ */
+ public static String post(String url) {
+ return post(url, "");
+ }
+
+ /**
+ * post请求
+ *
+ * @param url 请求地址
+ * @param jsonObject json格式的参数数据
+ * @return
+ * @author fengjundan
+ * @date 2018/6/2
+ */
+ public static String post(String url, JSONObject jsonObject) {
+ if (jsonObject != null) {
+ return post(url, jsonObject.toJSONString());
+ } else {
+ return post(url, "");
+ }
+ }
+
+ /**
+ * post请求
+ *
+ * @param url 请求地址
+ * @param jsonArray JSONArray格式的参数数据
+ * @return
+ * @author fengjundan
+ * @date 2018/6/2
+ */
+ public static String post(String url, JSONArray jsonArray) {
+ if (jsonArray != null) {
+ return post(url, jsonArray.toJSONString());
+ } else {
+ return post(url, "");
+ }
+ }
+
+ /**
+ * post请求
+ * @param url 请求地址
+ * @param map map请求参数
+ * @author fengjundan
+ * @date 2018/6/2
+ * @return public static String post(String url, Map map){
+ if(map != null){
+ String params = JSON.toJSONString(map);
+ return post(url, params);
+ } else{
+ return post(url, "");
+ }
+ }*/
+
+ /**
+ * post请求
+ *
+ * @param url 请求地址
+ * @param list list格式的参数数据
+ * @return
+ * @author fengjundan
+ * @date 2018/6/2
+ */
+ public static String post(String url, List