|
@ -368,12 +368,25 @@ public class ShopOrderController extends BaseController { |
|
|
} else { |
|
|
} else { |
|
|
// 生产环境 - 使用自动证书配置
|
|
|
// 生产环境 - 使用自动证书配置
|
|
|
final String certRootPath = certConfig.getCertRootPath(); |
|
|
final String certRootPath = certConfig.getCertRootPath(); |
|
|
final String certBasePath = certRootPath + "/file"; |
|
|
|
|
|
|
|
|
logger.info("生产环境证书根路径: {}", certRootPath); |
|
|
|
|
|
|
|
|
String privateKeyRelativePath = payment.getApiclientKey(); |
|
|
String privateKeyRelativePath = payment.getApiclientKey(); |
|
|
String privateKeyFullPath = privateKeyRelativePath.startsWith("/") |
|
|
|
|
|
? certBasePath + privateKeyRelativePath |
|
|
|
|
|
: certBasePath + "/" + privateKeyRelativePath; |
|
|
|
|
|
|
|
|
logger.info("数据库中的私钥相对路径: {}", privateKeyRelativePath); |
|
|
|
|
|
|
|
|
|
|
|
// 修复路径拼接逻辑:数据库中存储的路径如果已经包含 /file,则直接拼接
|
|
|
|
|
|
String privateKeyFullPath; |
|
|
|
|
|
if (privateKeyRelativePath.startsWith("/file/")) { |
|
|
|
|
|
// 路径已经包含 /file/ 前缀,直接拼接到根路径
|
|
|
|
|
|
privateKeyFullPath = certRootPath + privateKeyRelativePath; |
|
|
|
|
|
} else if (privateKeyRelativePath.startsWith("file/")) { |
|
|
|
|
|
// 路径包含 file/ 前缀,添加根路径和斜杠
|
|
|
|
|
|
privateKeyFullPath = certRootPath + "/" + privateKeyRelativePath; |
|
|
|
|
|
} else { |
|
|
|
|
|
// 路径不包含 file 前缀,添加完整的 /file/ 前缀
|
|
|
|
|
|
privateKeyFullPath = certRootPath + "/file/" + privateKeyRelativePath; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
logger.info("生产环境私钥完整路径: {}", privateKeyFullPath); |
|
|
String privateKey = certificateLoader.loadCertificatePath(privateKeyFullPath); |
|
|
String privateKey = certificateLoader.loadCertificatePath(privateKeyFullPath); |
|
|
String apiV3Key = payment.getApiKey(); |
|
|
String apiV3Key = payment.getApiKey(); |
|
|
|
|
|
|
|
|