李昊 4 years ago
parent
commit
98ee316a13
1 changed files with 7 additions and 5 deletions
  1. 7 5
      gx_api/GxPress/Api/GxPress.Api/Startup.cs

+ 7 - 5
gx_api/GxPress/Api/GxPress.Api/Startup.cs

@@ -121,15 +121,17 @@ namespace GxPress.Api
             app.UseMiddleware<ExceptionMiddleware>();
             app.UseRouting();
             app.UseJwtAuthorization();
-            app.UseDefaultFiles();
-            app.UseStaticFiles();
             app.UseStaticFiles(new StaticFileOptions
             {
-                FileProvider = new PhysicalFileProvider(
-            Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")),
-                RequestPath = "/",
                 ContentTypeProvider = provider
             });
+            // app.UseStaticFiles(new StaticFileOptions
+            // {
+            //     FileProvider = new PhysicalFileProvider(
+            // Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")),
+            //     RequestPath = "",
+            //     ContentTypeProvider = provider
+            // });
             app.UseDirectoryBrowser(new DirectoryBrowserOptions
             {
                 FileProvider = new PhysicalFileProvider(