图片加前缀

This commit is contained in:
yanghongwei 2025-04-04 22:01:40 +08:00
parent 0954cb5738
commit 8845f90cd3
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ namespace LY.App.Controllers
{ {
file.CopyTo(stream); file.CopyTo(stream);
} }
result.data = $"/{uploadPath}/{fileName}"; result.data = $"/api/{uploadPath}/{fileName}";
result.code = 0; result.code = 0;
return Ok(result); return Ok(result);
} }

View File

@ -100,7 +100,7 @@ await device?.Init();
app.UseStaticFiles(new StaticFileOptions() app.UseStaticFiles(new StaticFileOptions()
{ {
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "Img")), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "Img")),
RequestPath = "/upload" RequestPath = "/api/upload"
}); });
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment()) if (app.Environment.IsDevelopment())