Bläddra i källkod

1、修改微信小程序生成保存路径,如果不配置,则默认保存在项目根目录

胖太乙 1 år sedan
förälder
incheckning
8f16fefc07

+ 1 - 1
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": {

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/Wechat/SysWxOpenService.cs

@@ -282,6 +282,7 @@ public class SysWxOpenService : IDynamicApiController, ITransient
         if (response.IsSuccessful())
         {
             var QRImagePath = App.GetConfig<string>("Wechat:QRImagePath");
+            QRImagePath = string.IsNullOrEmpty(QRImagePath) ? Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "QRImage") : QRImagePath;
             //判断文件存放路径是否存在
             if (!Directory.Exists(QRImagePath))
             {