😎调整文件路径格式

This commit is contained in:
zuohuaijun 2024-10-22 13:14:03 +08:00
parent fc2b3ee500
commit a41021ea3a
3 changed files with 7 additions and 14 deletions

View File

@ -42,7 +42,7 @@
<PackageReference Include="SqlSugarCore" Version="5.1.4.169" />
<PackageReference Include="SSH.NET" Version="2024.1.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.6" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1109" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1110" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup>

View File

@ -38,7 +38,7 @@ public class AppEventSubscriber : IEventSubscriber, ISingleton, IDisposable
[EventSubscribe(CommonConst.SendErrorMail)]
public async Task SendOrderErrorMail(EventHandlerExecutingContext context)
{
//var mailTempPath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Temp\\ErrorMail.tp");
//var mailTempPath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Temp", "ErrorMail.tp");
//var mailTemp = File.ReadAllText(mailTempPath);
//var mail = await _serviceScope.ServiceProvider.GetRequiredService<IViewEngine>().RunCompileFromCachedAsync(mailTemp, );

View File

@ -195,12 +195,7 @@ public class SysWxOpenService : IDynamicApiController, ITransient
public string VerifySignature([FromQuery] VerifySignatureInput input)
{
bool valid = _wechatApiClient.VerifyEventSignatureForEcho(input.Timestamp, input.Nonce, input.Signature);
if (!valid)
{
return "fail";
}
return input.Echostr;
return !valid ? "fail" : input.Echostr;
}
/// <summary>
@ -300,17 +295,15 @@ public class SysWxOpenService : IDynamicApiController, ITransient
if (response.IsSuccessful())
{
var QRImagePath = App.GetConfig<string>("Wechat:QRImagePath");
//判断文件存放路径是否存在
// 判断文件存放路径是否存在
if (!Directory.Exists(QRImagePath))
{
Directory.CreateDirectory(QRImagePath);
}
// 将二维码图片数据保存为文件
var filePath = QRImagePath + $"\\{input.ImageName.ToUpper()}.png";
var filePath = Path.Combine(QRImagePath, $"{input.ImageName.ToUpper()}.png");
if (File.Exists(filePath))
{
File.Delete(filePath);
}
File.WriteAllBytes(filePath, response.GetRawBytes());
generateQRImageOutInput.Success = true;