Compare commits
No commits in common. "d951ea585796088690bf3138d76e5c8d569e59a5" and "9cfe5cbb8478db548c51063c45851721d1dbd10a" have entirely different histories.
d951ea5857
...
9cfe5cbb84
@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Serilog;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Serilog.Sinks.MariaDB.Extensions;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@ -160,15 +159,10 @@ app.Use(async (context, next) =>
|
||||
});
|
||||
*/
|
||||
|
||||
var uploadsPath = Path.Combine(Directory.GetCurrentDirectory(), "uploads");
|
||||
if (!Directory.Exists(uploadsPath))
|
||||
{
|
||||
Directory.CreateDirectory(uploadsPath); // 如果目录不存在,创建它
|
||||
}
|
||||
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(uploadsPath),
|
||||
FileProvider = new PhysicalFileProvider(
|
||||
Path.Combine(Directory.GetCurrentDirectory(), "uploads")),
|
||||
RequestPath = "/uploads"
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user