1.后端框架使用的是Laravel,使用maatwebsite/excel导出列表数据时报警了(数据能正常导出)index:696 Resource interpreted as Document but transferred with MIME type application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
2.后端控制器代码如下:
//导出采购计划
public function exportExcel()
{
return Excel::download(new ProcurementExport(), '商品导出表.xlsx');
}
3.前端代码如下,使用的是vue+elementUi
<el-button onclick="location.href='{{action('Admin\administrative\other\ProcurementController@exportExcel')}}'">导出数据</el-button>
4.百度搜到说用post方式就不会报警,但我不知道该怎么修改,望各位大神帮助~
写个接口,请求方式是post点击后调用这个接口