Uat_Study
he 2023-05-16 18:05:25 +08:00
commit 74c3b2c180
2 changed files with 25 additions and 20 deletions

View File

@ -49,7 +49,7 @@ namespace IRaCIS.Core.API
var isDicomFile = path.Contains($"{StaticData.Folder.DicomFolder}");
var defaultFileProvider = new PhysicalFileProvider(iRaCISDefaultDataFolder);
var defaultFileProvider = new PhysicalFileProvider(FileStoreHelper.GetIRaCISRootPath(_hostingEnv));
var staticFileOptions = new StaticFileOptions
{
FileProvider = defaultFileProvider,
@ -65,12 +65,11 @@ namespace IRaCIS.Core.API
{
if (defaultFileProvider.GetFileInfo(context.Request.Path).Exists)
{
//var staticFileMiddleware = new StaticFileMiddleware(_next, _hostingEnv, Options.Create(staticFileOptions), _loggerFactory);
//await staticFileMiddleware.Invoke(context);
var actrualPath = defaultFileProvider.GetFileInfo(context.Request.Path).PhysicalPath;
await context.Response.SendFileAsync(new PhysicalFileInfo(new FileInfo(actrualPath)));
return;
}
}

View File

@ -147,8 +147,11 @@ namespace IRaCIS.Core.Application.Services
#region 切换磁盘存储后
var physicalPath = string.Empty;
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
//不存在,去其他路径找
if (!File.Exists(physicalPath))
{
//找到所有磁盘
var drives = DriveInfo.GetDrives()
.Where(d => d.DriveType == DriveType.Fixed && d.IsReady)
@ -170,6 +173,9 @@ namespace IRaCIS.Core.Application.Services
break;
}
}
}
#endregion