文件上传功能优化

This commit is contained in:
陈淳
2022-10-12 14:43:35 +08:00
parent 4a54eb56a7
commit dd7bbb138a
72 changed files with 104 additions and 68 deletions

View File

@@ -31,7 +31,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
public IActionResult Template()
{
List<T> users = new();
var fileName = nameof(T) + PathConst.DataTemplate;
var fileName = typeof(T).Name + PathConst.DataTemplate;
var path = ExcelHelper.DownloadImportTemplate(users, fileName, Path.Combine(PathConst.wwwroot, PathEnum.Excel.ToString()));
var file = System.IO.File.OpenRead(path);
return File(file, "text/plain", $"{DateTime.Now.ToString("yyyyMMddHHmmssffff") + fileName }.xlsx");