😎调整文件路径格式

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="SqlSugarCore" Version="5.1.4.169" />
<PackageReference Include="SSH.NET" Version="2024.1.0" /> <PackageReference Include="SSH.NET" Version="2024.1.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.6" /> <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="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" /> <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup> </ItemGroup>

View File

@ -38,7 +38,7 @@ public class AppEventSubscriber : IEventSubscriber, ISingleton, IDisposable
[EventSubscribe(CommonConst.SendErrorMail)] [EventSubscribe(CommonConst.SendErrorMail)]
public async Task SendOrderErrorMail(EventHandlerExecutingContext context) 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 mailTemp = File.ReadAllText(mailTempPath);
//var mail = await _serviceScope.ServiceProvider.GetRequiredService<IViewEngine>().RunCompileFromCachedAsync(mailTemp, ); //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) public string VerifySignature([FromQuery] VerifySignatureInput input)
{ {
bool valid = _wechatApiClient.VerifyEventSignatureForEcho(input.Timestamp, input.Nonce, input.Signature); bool valid = _wechatApiClient.VerifyEventSignatureForEcho(input.Timestamp, input.Nonce, input.Signature);
if (!valid) return !valid ? "fail" : input.Echostr;
{
return "fail";
}
return input.Echostr;
} }
/// <summary> /// <summary>
@ -300,17 +295,15 @@ public class SysWxOpenService : IDynamicApiController, ITransient
if (response.IsSuccessful()) if (response.IsSuccessful())
{ {
var QRImagePath = App.GetConfig<string>("Wechat:QRImagePath"); var QRImagePath = App.GetConfig<string>("Wechat:QRImagePath");
//判断文件存放路径是否存在 // 判断文件存放路径是否存在
if (!Directory.Exists(QRImagePath)) if (!Directory.Exists(QRImagePath))
{
Directory.CreateDirectory(QRImagePath); Directory.CreateDirectory(QRImagePath);
}
// 将二维码图片数据保存为文件 // 将二维码图片数据保存为文件
var filePath = QRImagePath + $"\\{input.ImageName.ToUpper()}.png"; var filePath = Path.Combine(QRImagePath, $"{input.ImageName.ToUpper()}.png");
if (File.Exists(filePath)) if (File.Exists(filePath))
{
File.Delete(filePath); File.Delete(filePath);
}
File.WriteAllBytes(filePath, response.GetRawBytes()); File.WriteAllBytes(filePath, response.GetRawBytes());
generateQRImageOutInput.Success = true; generateQRImageOutInput.Success = true;