easyexcel使用问题:使用时导出的excel文件损坏,打开不了,后台没异常错误

错误问题:使用时导出的excel文件损坏,打开不了,后台没异常错误

解决方式:因为前端使用的是blob,最后定位错误在前端发送请求时漏了一个参数,

responseType: 'blob'
export function exportExcel(parameter) {
  return request({
    url: '/appointment/export' ,
    method: 'post',
    responseType: 'blob',
    data: parameter
  })
}

图片:

 加上这个就可以正常了。

猜你喜欢

转载自blog.csdn.net/Jackbillzsc/article/details/125782102
今日推荐