Browse Source

1. 加入虛擬路徑判斷

master
Sai 8 months ago
parent
commit
f624d6ffe3
  1. 4
      AMESCoreStudio.Web/Startup.cs

4
AMESCoreStudio.Web/Startup.cs

@ -79,12 +79,16 @@ namespace AMESCoreStudio.Web
if (config != null) if (config != null)
{ {
config.ForEach(f => config.ForEach(f =>
{
try
{ {
fileServerOptions.Add(new FileServerOptions fileServerOptions.Add(new FileServerOptions
{ {
FileProvider = new PhysicalFileProvider(@f.RealPath), FileProvider = new PhysicalFileProvider(@f.RealPath),
RequestPath = new PathString(f.RequestPath), RequestPath = new PathString(f.RequestPath),
}); });
}
catch { }
}); });
}; };
services.AddSingleton<IFileServerProvider>(new FileServerProvider(fileServerOptions)); services.AddSingleton<IFileServerProvider>(new FileServerProvider(fileServerOptions));

Loading…
Cancel
Save