diff --git a/ZR.Admin.WebApi/Program.cs b/ZR.Admin.WebApi/Program.cs index 548b290..29f3e89 100644 --- a/ZR.Admin.WebApi/Program.cs +++ b/ZR.Admin.WebApi/Program.cs @@ -1,20 +1,28 @@ using AspNetCoreRateLimit; + +using Infrastructure; using Infrastructure.Converter; + using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.StaticFiles; + using NLog.Web; + +using SKIT.FlurlHttpClient.Wechat.Api; + using SqlSugar; + using System.Globalization; using System.Text.Json; + using ZR.Admin.WebApi.Extensions; using ZR.Common.Cache; using ZR.Common.DynamicApiSimple.Extens; using ZR.Infrastructure.WebExtensions; +using ZR.Mall; using ZR.ServiceCore.Signalr; using ZR.ServiceCore.SqlSugar; -using ZR.Mall; -using SKIT.FlurlHttpClient.Wechat.Api; -using Infrastructure; //using SQLitePCL; var builder = WebApplication.CreateBuilder(args); @@ -156,8 +164,22 @@ app.Use((context, next) => //} return next(); }); +// 创建 MIME 类型映射器 +var provider = new FileExtensionContentTypeProvider(); + +// 如果没有 .apk,就手动添加 +if (!provider.Mappings.ContainsKey(".apk")) +{ + provider.Mappings[".apk"] = "application/vnd.android.package-archive"; +} + +// 使用扩展的 StaticFiles 中间件 +app.UseStaticFiles(new StaticFileOptions +{ + ContentTypeProvider = provider +}); //开启访问静态文件/wwwroot目录文件,要放在UseRouting前面 -app.UseStaticFiles(); +//app.UseStaticFiles(); //开启路由访问 app.UseRouting(); #if DEBUG diff --git a/ZR.Admin.WebApi/wwwroot/file/2025/0923/1ed00a304e1802ba.apk b/ZR.Admin.WebApi/wwwroot/file/2025/0923/1ed00a304e1802ba.apk new file mode 100644 index 0000000..7ea0587 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/file/2025/0923/1ed00a304e1802ba.apk differ