导出execl

 

api层

//导出Excel项目关联合同
[HttpGet]
public IActionResult ExportContract()
{
var list = _hongDal.GetProject(1, 3, "", "", "", 0, 0);
var meno = new MemoryStream();
meno.SaveAs(list.PageData);
meno.Seek(0, SeekOrigin.Begin);
return new FileStreamResult(meno, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
FileDownloadName = "demo.xlsx"
};
}

vue

 location.href=`http://localhost:24310/api/Server/ExportContract`;

 

上一篇:vue 导出execl


下一篇:谈谈form-data请求格式 js