解决前端做excel下载报错Content type ‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charse

后端设置的请求头是application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,前端设置这个就报错。要设置成application/json,就可以成功导出表格了,

`responseType` 表示服务器响应的数据类型,可以是 'arraybuffer', 'blob', 'document', 'json', 'text', 'stream'

猜你喜欢

转载自blog.csdn.net/m0_53942074/article/details/139991799