|
|
@ -774,18 +774,22 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder |
|
|
|
String privateKeyRelativePath = payment.getApiclientKey(); |
|
|
|
System.out.println("数据库中的私钥相对路径: " + privateKeyRelativePath); |
|
|
|
|
|
|
|
// 修复路径拼接逻辑:数据库中存储的路径如果已经包含 /file,则直接拼接
|
|
|
|
// 生产环境已经没有/file目录,所有路径都直接拼接到根路径
|
|
|
|
String privateKeyFullPath; |
|
|
|
// 处理数据库中可能存在的历史路径格式
|
|
|
|
String cleanPath = privateKeyRelativePath; |
|
|
|
if (privateKeyRelativePath.startsWith("/file/")) { |
|
|
|
// 路径已经包含 /file/ 前缀,直接拼接到根路径
|
|
|
|
privateKeyFullPath = certRootPath + privateKeyRelativePath; |
|
|
|
// 去掉历史的 /file/ 前缀
|
|
|
|
cleanPath = privateKeyRelativePath.substring(6); |
|
|
|
} else if (privateKeyRelativePath.startsWith("file/")) { |
|
|
|
// 路径包含 file/ 前缀,添加根路径和斜杠
|
|
|
|
privateKeyFullPath = certRootPath + "/" + privateKeyRelativePath; |
|
|
|
} else { |
|
|
|
// 路径不包含 file 前缀,添加完整的 /file/ 前缀
|
|
|
|
privateKeyFullPath = certRootPath + "/file/" + privateKeyRelativePath; |
|
|
|
// 去掉历史的 file/ 前缀
|
|
|
|
cleanPath = privateKeyRelativePath.substring(5); |
|
|
|
} |
|
|
|
// 确保路径以 / 开头
|
|
|
|
if (!cleanPath.startsWith("/")) { |
|
|
|
cleanPath = "/" + cleanPath; |
|
|
|
} |
|
|
|
privateKeyFullPath = certRootPath + cleanPath; |
|
|
|
|
|
|
|
System.out.println("生产环境私钥完整路径: " + privateKeyFullPath); |
|
|
|
privateKey = certificateLoader.loadCertificatePath(privateKeyFullPath); |
|
|
@ -804,18 +808,22 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder |
|
|
|
String pubKeyRelativePath = payment.getPubKey(); |
|
|
|
System.out.println("数据库中的公钥相对路径: " + pubKeyRelativePath); |
|
|
|
|
|
|
|
// 修复公钥路径拼接逻辑,与私钥路径处理保持一致
|
|
|
|
// 生产环境已经没有/file目录,所有路径都直接拼接到根路径
|
|
|
|
String pubKeyFullPath; |
|
|
|
// 处理数据库中可能存在的历史路径格式
|
|
|
|
String cleanPubPath = pubKeyRelativePath; |
|
|
|
if (pubKeyRelativePath.startsWith("/file/")) { |
|
|
|
// 路径已经包含 /file/ 前缀,直接拼接到根路径
|
|
|
|
pubKeyFullPath = certRootPath + pubKeyRelativePath; |
|
|
|
// 去掉历史的 /file/ 前缀
|
|
|
|
cleanPubPath = pubKeyRelativePath.substring(6); |
|
|
|
} else if (pubKeyRelativePath.startsWith("file/")) { |
|
|
|
// 路径包含 file/ 前缀,添加根路径和斜杠
|
|
|
|
pubKeyFullPath = certRootPath + "/" + pubKeyRelativePath; |
|
|
|
} else { |
|
|
|
// 路径不包含 file 前缀,添加完整的 /file/ 前缀
|
|
|
|
pubKeyFullPath = certRootPath + "/file/" + pubKeyRelativePath; |
|
|
|
// 去掉历史的 file/ 前缀
|
|
|
|
cleanPubPath = pubKeyRelativePath.substring(5); |
|
|
|
} |
|
|
|
// 确保路径以 / 开头
|
|
|
|
if (!cleanPubPath.startsWith("/")) { |
|
|
|
cleanPubPath = "/" + cleanPubPath; |
|
|
|
} |
|
|
|
pubKeyFullPath = certRootPath + cleanPubPath; |
|
|
|
|
|
|
|
System.out.println("生产环境公钥完整路径: " + pubKeyFullPath); |
|
|
|
pubKeyFile = certificateLoader.loadCertificatePath(pubKeyFullPath); |
|
|
@ -977,18 +985,22 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder |
|
|
|
|
|
|
|
String privateKeyRelativePath = payment.getApiclientKey(); |
|
|
|
|
|
|
|
// 修复路径拼接逻辑:数据库中存储的路径如果已经包含 /file,则直接拼接
|
|
|
|
// 生产环境已经没有/file目录,所有路径都直接拼接到根路径
|
|
|
|
String privateKeyFullPath; |
|
|
|
// 处理数据库中可能存在的历史路径格式
|
|
|
|
String cleanPath2 = privateKeyRelativePath; |
|
|
|
if (privateKeyRelativePath.startsWith("/file/")) { |
|
|
|
// 路径已经包含 /file/ 前缀,直接拼接到根路径
|
|
|
|
privateKeyFullPath = certRootPath + privateKeyRelativePath; |
|
|
|
// 去掉历史的 /file/ 前缀
|
|
|
|
cleanPath2 = privateKeyRelativePath.substring(6); |
|
|
|
} else if (privateKeyRelativePath.startsWith("file/")) { |
|
|
|
// 路径包含 file/ 前缀,添加根路径和斜杠
|
|
|
|
privateKeyFullPath = certRootPath + "/" + privateKeyRelativePath; |
|
|
|
} else { |
|
|
|
// 路径不包含 file 前缀,添加完整的 /file/ 前缀
|
|
|
|
privateKeyFullPath = certRootPath + "/file/" + privateKeyRelativePath; |
|
|
|
// 去掉历史的 file/ 前缀
|
|
|
|
cleanPath2 = privateKeyRelativePath.substring(5); |
|
|
|
} |
|
|
|
// 确保路径以 / 开头
|
|
|
|
if (!cleanPath2.startsWith("/")) { |
|
|
|
cleanPath2 = "/" + cleanPath2; |
|
|
|
} |
|
|
|
privateKeyFullPath = certRootPath + cleanPath2; |
|
|
|
|
|
|
|
System.out.println("私钥完整路径: " + privateKeyFullPath); |
|
|
|
privateKey = certificateLoader.loadCertificatePath(privateKeyFullPath); |
|
|
@ -1000,18 +1012,22 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder |
|
|
|
String pubKeyRelativePath = payment.getPubKey(); |
|
|
|
System.out.println("数据库中的公钥相对路径: " + pubKeyRelativePath); |
|
|
|
|
|
|
|
// 修复公钥路径拼接逻辑,与私钥路径处理保持一致
|
|
|
|
// 生产环境已经没有/file目录,所有路径都直接拼接到根路径
|
|
|
|
String pubKeyFullPath; |
|
|
|
// 处理数据库中可能存在的历史路径格式
|
|
|
|
String cleanPubPath2 = pubKeyRelativePath; |
|
|
|
if (pubKeyRelativePath.startsWith("/file/")) { |
|
|
|
// 路径已经包含 /file/ 前缀,直接拼接到根路径
|
|
|
|
pubKeyFullPath = certRootPath + pubKeyRelativePath; |
|
|
|
// 去掉历史的 /file/ 前缀
|
|
|
|
cleanPubPath2 = pubKeyRelativePath.substring(6); |
|
|
|
} else if (pubKeyRelativePath.startsWith("file/")) { |
|
|
|
// 路径包含 file/ 前缀,添加根路径和斜杠
|
|
|
|
pubKeyFullPath = certRootPath + "/" + pubKeyRelativePath; |
|
|
|
} else { |
|
|
|
// 路径不包含 file 前缀,添加完整的 /file/ 前缀
|
|
|
|
pubKeyFullPath = certRootPath + "/file/" + pubKeyRelativePath; |
|
|
|
// 去掉历史的 file/ 前缀
|
|
|
|
cleanPubPath2 = pubKeyRelativePath.substring(5); |
|
|
|
} |
|
|
|
// 确保路径以 / 开头
|
|
|
|
if (!cleanPubPath2.startsWith("/")) { |
|
|
|
cleanPubPath2 = "/" + cleanPubPath2; |
|
|
|
} |
|
|
|
pubKeyFullPath = certRootPath + cleanPubPath2; |
|
|
|
|
|
|
|
System.out.println("生产环境公钥完整路径: " + pubKeyFullPath); |
|
|
|
pubKey = certificateLoader.loadCertificatePath(pubKeyFullPath); |
|
|
|