import{_ as n,o as s,c as a,a as t}from"./app-4f4af2d5.js";const p={},o=t(`

前端下载文件注意事项

如果前端下载没有名称,需要通过一下方式在后端返回文件流时,设置文件名称

后端返回文件流

HttpContext.DownLoadFile(data, Tools.GetFileContentType[".xls"].ToStr(), name);

/// <summary>
/// 导出Excel
/// </summary>
/// <param name="pagingSearchInput"></param>
/// <returns></returns>
[ApiResourceCacheFilter(5)]
[ActionDescriptor(PermissionFunctionConsts.Function_Export, DisplayName = "导出数据")]
[HttpPost]
public async Task ExportExcelAsync([FromBody] PagingSearchInput<Member> pagingSearchInput)
{
    var data = await _defaultService.ExportExcelAsync(pagingSearchInput);
    var name = $"{PermissionUtil.GetControllerDisplayName(GetType())}列表数据 {DateTime.Now.ToString("yyyy-MM-dd")}.xls";
    HttpContext.DownLoadFile(data, Tools.GetFileContentType[".xls"].ToStr(), name);
}
`,5),e=[o];function c(l,u){return s(),a("div",null,e)}const k=n(p,[["render",c],["__file","download.html.vue"]]);export{k as default};