Commit f8412f3d authored by libin's avatar libin

微信支付修改

parent fa1681e1
...@@ -18,11 +18,11 @@ import org.apache.http.impl.client.HttpClients; ...@@ -18,11 +18,11 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.protocol.HttpContext; import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.jdom.JDOMException; import org.jdom.JDOMException;
import org.springframework.core.io.ClassPathResource;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.security.KeyStore; import java.security.KeyStore;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
...@@ -80,8 +80,11 @@ public class WXSuppToUserPay { ...@@ -80,8 +80,11 @@ public class WXSuppToUserPay {
try { try {
KeyStore keyStore = KeyStore.getInstance("PKCS12"); KeyStore keyStore = KeyStore.getInstance("PKCS12");
// FileInputStream instream = new FileInputStream(new File("E:/cert/apiclient_cert.p12")); // FileInputStream instream = new FileInputStream(new File("E:/cert/apiclient_cert.p12"));
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath(); // String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath();
FileInputStream instream = new FileInputStream(new File(path+"/apiclient_cert.p12")); // FileInputStream instream = new FileInputStream(new File(path+"/apiclient_cert.p12"));
// InputStream resourceAsStream = this.getClass().getResourceAsStream("apiclient_cert.p12");
ClassPathResource classPathResource = new ClassPathResource("apiclient_cert.p12");
InputStream instream = classPathResource.getInputStream();
try { try {
keyStore.load(instream, SystemConfig.APP_PARTNER.toCharArray()); keyStore.load(instream, SystemConfig.APP_PARTNER.toCharArray());
} finally { } finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment