This commit is contained in:
橙子
2021-11-03 19:20:38 +08:00
parent b0a7408177
commit 2e4f024928
3 changed files with 8 additions and 6 deletions

View File

@@ -36,12 +36,14 @@ namespace Yi.Framework.ApiMicroservice.Controllers
await _userService.UpdateAsync(user_data);
return Result.Success();
}
[Route("{type}/{fileNmae}")]
[HttpGet]
public IActionResult Get(string type, string imageNmae)
public IActionResult Get(string type, string fileNmae)
{
var path = Path.Combine($"wwwroot\\{type}", imageNmae);
var path = Path.Combine($"wwwroot\\{type}", fileNmae);
var stream = System.IO.File.OpenRead(path);
var MimeType = Common.Helper.MimeHelper.GetMimeMapping(imageNmae);
var MimeType = Common.Helper.MimeHelper.GetMimeMapping(fileNmae);
return new FileStreamResult(stream, MimeType);
}