|
|
@ -14,6 +14,7 @@ using WebApiClient; |
|
|
|
using System.Globalization; |
|
|
|
using Microsoft.AspNetCore.Mvc.Razor; |
|
|
|
using Microsoft.AspNetCore.Localization; |
|
|
|
using AMESCoreStudio.Web.Code; |
|
|
|
|
|
|
|
namespace AMESCoreStudio.Web |
|
|
|
{ |
|
|
@ -34,30 +35,44 @@ namespace AMESCoreStudio.Web |
|
|
|
|
|
|
|
// 郎�ヘ魁
|
|
|
|
//Add our IFileServerProvider implementation as a singleton
|
|
|
|
services.AddSingleton<IFileServerProvider>(new FileServerProvider( |
|
|
|
new List<FileServerOptions> |
|
|
|
//services.AddSingleton<IFileServerProvider>(new FileServerProvider(
|
|
|
|
// new List<FileServerOptions>
|
|
|
|
// {
|
|
|
|
// new FileServerOptions
|
|
|
|
// {
|
|
|
|
// // ¹êÅé¸ô®|
|
|
|
|
// FileProvider = new PhysicalFileProvider(@"\\10.0.8.7\\shop"),
|
|
|
|
// // µêÀÀ¸ô®|
|
|
|
|
// RequestPath = new PathString("/aa"),
|
|
|
|
// EnableDirectoryBrowsing = true
|
|
|
|
// }
|
|
|
|
// new FileServerOptions
|
|
|
|
// {
|
|
|
|
// FileProvider = new PhysicalFileProvider(@"//qasrv-n/Web/ISOZone/"),
|
|
|
|
// RequestPath = new PathString("/DocEsop"),
|
|
|
|
// EnableDirectoryBrowsing = true
|
|
|
|
// }
|
|
|
|
// }));
|
|
|
|
|
|
|
|
var config = Configuration.Get<VirtualPathConfig>().VirtualPath; |
|
|
|
var fileServerOptions = new List<FileServerOptions>(); |
|
|
|
if (config != null) |
|
|
|
{ |
|
|
|
config.ForEach(f => |
|
|
|
{ |
|
|
|
//new FileServerOptions
|
|
|
|
//{
|
|
|
|
// // ¹êÅé¸ô®|
|
|
|
|
// FileProvider = new PhysicalFileProvider(@"\\10.0.8.7\\shop"),
|
|
|
|
// // µêÀÀ¸ô®|
|
|
|
|
// RequestPath = new PathString("/aa"),
|
|
|
|
// EnableDirectoryBrowsing = true
|
|
|
|
//}
|
|
|
|
new FileServerOptions |
|
|
|
fileServerOptions.Add(new FileServerOptions |
|
|
|
{ |
|
|
|
FileProvider = new PhysicalFileProvider(@"//qasrv-n/Web/ISOZone/"), |
|
|
|
RequestPath = new PathString("/DocEsop"), |
|
|
|
EnableDirectoryBrowsing = true |
|
|
|
} |
|
|
|
})); |
|
|
|
|
|
|
|
FileProvider = new PhysicalFileProvider(@f.RealPath), |
|
|
|
RequestPath = new PathString(f.RequestPath), |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
services.AddSingleton<IFileServerProvider>(new FileServerProvider(fileServerOptions)); |
|
|
|
|
|
|
|
// 配置跨域处理,允许所有来源
|
|
|
|
services.AddCors(options => |
|
|
|
options.AddPolicy("AMESPolicy", |
|
|
|
p => p.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod())); |
|
|
|
options.AddPolicy("AMESPolicy", |
|
|
|
p => p.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod())); |
|
|
|
|
|
|
|
|
|
|
|
services.AddLocalization(o => |
|
|
|