|
@@ -3,6 +3,7 @@ package thyyxxk.webserver.utils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import java.io.*;
|
|
|
+import java.nio.file.Files;
|
|
|
|
|
|
/**
|
|
|
* @author dj
|
|
@@ -13,11 +14,16 @@ public class WxCertUtil {
|
|
|
public static final String MERCHANT_ID = "1574204121";
|
|
|
public static final String MERCHANT_KEY = "lilaiwflzIOLJI2320JLZL2Llisd02ak";
|
|
|
public static final String CERT_PATH = "D:\\a.snapshot\\zwxcert\\apiclient_cert.p12";
|
|
|
+ public static final String CERT_PATH2 = "/home/zwxcert/apiclient_cert.p12";
|
|
|
public static byte[] CERTDATA;
|
|
|
static {
|
|
|
try {
|
|
|
File file = new File(CERT_PATH);
|
|
|
- InputStream certStream = new FileInputStream(file);
|
|
|
+ if (!file.exists()) {
|
|
|
+ file = new File(CERT_PATH2);
|
|
|
+ }
|
|
|
+// InputStream certStream = new FileInputStream(file);
|
|
|
+ InputStream certStream = Files.newInputStream(file.toPath());
|
|
|
CERTDATA = new byte[(int) file.length()];
|
|
|
//noinspection ResultOfMethodCallIgnored
|
|
|
certStream.read(CERTDATA);
|