|
@@ -3,6 +3,7 @@ using Admin.NET.Core.Service;
|
|
|
using AspNetCoreRateLimit;
|
|
using AspNetCoreRateLimit;
|
|
|
using Furion;
|
|
using Furion;
|
|
|
using Furion.SpecificationDocument;
|
|
using Furion.SpecificationDocument;
|
|
|
|
|
+using Furion.VirtualFileServer;
|
|
|
using IGeekFan.AspNetCore.Knife4jUI;
|
|
using IGeekFan.AspNetCore.Knife4jUI;
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
@@ -220,7 +221,14 @@ public class Startup : AppStartup
|
|
|
//// 启用HTTPS
|
|
//// 启用HTTPS
|
|
|
//app.UseHttpsRedirection();
|
|
//app.UseHttpsRedirection();
|
|
|
|
|
|
|
|
- app.UseStaticFiles();
|
|
|
|
|
|
|
+ // 特定文件类型(文件后缀)处理
|
|
|
|
|
+ var contentTypeProvider = FS.GetFileExtensionContentTypeProvider();
|
|
|
|
|
+ //contentTypeProvider.Mappings[".文件后缀"] = "MIME 类型"; // 注意文件后缀以 . 开头
|
|
|
|
|
+ // 可多个....
|
|
|
|
|
+ app.UseStaticFiles(new StaticFileOptions
|
|
|
|
|
+ {
|
|
|
|
|
+ ContentTypeProvider = contentTypeProvider
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
app.UseRouting();
|
|
app.UseRouting();
|
|
|
|
|
|