资金监控改成字节流导出
This commit is contained in:
@@ -924,7 +924,14 @@ namespace YLErp.Web.Controllers
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
new ExcelTemplateGenerator().SetTemplateFile(sourceFileName).SetTemplateData(modleDict).OutputToFile(result.PhysicalPath);
|
||||
|
||||
return JsonSuccess("导出资金监控成功", result.WebPath);
|
||||
// 读取字节流
|
||||
byte[] fileBytes = System.IO.File.ReadAllBytes(result.PhysicalPath);
|
||||
|
||||
// 删除临时文件
|
||||
System.IO.File.Delete(result.PhysicalPath);
|
||||
|
||||
// 返回文件流
|
||||
return File(fileBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", targetFileName);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
Reference in New Issue
Block a user