diff --git a/Admin.NET/Admin.NET.Application/Configuration/Wechat.json b/Admin.NET/Admin.NET.Application/Configuration/Wechat.json index dc59db4e..cbbac810 100644 --- a/Admin.NET/Admin.NET.Application/Configuration/Wechat.json +++ b/Admin.NET/Admin.NET.Application/Configuration/Wechat.json @@ -12,7 +12,7 @@ "WxOpenAppSecret": "", "WxToken": "", // 小程序消息推送中的令牌(Token) "WxEncodingAESKey": "", // 小程序消息推送中的消息加解密密钥(EncodingAESKey) - "QRImagePath": "" //小程序生成带参数二维码保存位置(绝对路径 eg: D:\\Web\\wwwroot\\upload\\QRImage) + "QRImagePath": "" // 小程序生成带参数二维码保存位置(绝对路径 eg: D:\\Web\\wwwroot\\upload\\QRImage),若不配置,则默认保存 wwwroot\\upload\\QRImage }, // 微信支付 "WechatPay": { diff --git a/Admin.NET/Admin.NET.Core/Service/Wechat/SysWxOpenService.cs b/Admin.NET/Admin.NET.Core/Service/Wechat/SysWxOpenService.cs index c88269f8..4ecd6ea5 100644 --- a/Admin.NET/Admin.NET.Core/Service/Wechat/SysWxOpenService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Wechat/SysWxOpenService.cs @@ -297,6 +297,7 @@ public class SysWxOpenService : IDynamicApiController, ITransient if (response.IsSuccessful()) { var QRImagePath = App.GetConfig("Wechat:QRImagePath"); + QRImagePath = string.IsNullOrEmpty(QRImagePath) ? Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "QRImage") : QRImagePath; // 判断文件存放路径是否存在 if (!Directory.Exists(QRImagePath)) Directory.CreateDirectory(QRImagePath);