fixed: 微信支付证书路径问题

This commit is contained in:
coolcalf 2024-07-22 23:01:56 +08:00
parent 1ca94438a1
commit e3feb6cad8

View File

@ -38,10 +38,10 @@ public class SysWechatPayService : IDynamicApiController, ITransient
/// <returns></returns> /// <returns></returns>
private WechatTenpayClient CreateTenpayClient() private WechatTenpayClient CreateTenpayClient()
{ {
var cerFilePath = _wechatPayOptions.MerchantCertificatePrivateKey; var cerFilePath = App.WebHostEnvironment.ContentRootPath + _wechatPayOptions.MerchantCertificatePrivateKey;
if (!File.Exists(cerFilePath)) if (!File.Exists(cerFilePath))
throw Oops.Oh<Exception>("商户证书文件不存在:" + cerFilePath); Log.Warning("商户证书文件不存在:" + cerFilePath);
var tenpayClientOptions = new WechatTenpayClientOptions() var tenpayClientOptions = new WechatTenpayClientOptions()
{ {