From e9330592011b375fc380995ccf587a98709d8724 Mon Sep 17 00:00:00 2001 From: “wangming” <“wangming@antissoft.com”> Date: Wed, 18 Mar 2026 16:47:15 +0800 Subject: [PATCH] 更新 YiAbpWebModule.cs,优化静态资源处理逻辑,添加前端静态资源支持,并调整 API 静态资源访问路径 --- 美国版/Food Labeling Management Code/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs index fb3d053..d8ccbaa 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs @@ -379,11 +379,14 @@ namespace Yi.Abp.Web //请求处理 app.UseApiInfoHandling(); - //静态资源 + //前端静态资源(wwwroot 根目录直接访问) + app.UseDefaultFiles(); + app.UseStaticFiles(); + + //API 静态资源(通过 /api/app/wwwroot 路径访问) app.UseStaticFiles(new StaticFileOptions { RequestPath = "/api/app/wwwroot", - // 可以在这里添加或修改MIME类型映射 ContentTypeProvider = new FileExtensionContentTypeProvider { Mappings = @@ -392,7 +395,6 @@ namespace Yi.Abp.Web } } }); - app.UseDefaultFiles(); app.UseDirectoryBrowser("/api/app/wwwroot"); app.Properties.Add("_AbpExceptionHandlingMiddleware_Added", false); -- libgit2 0.21.4