后端返回blob-文件下载乱码-前端解决方案
目录
后端返回blob 文件下载乱码 前端解决方案
后端返回blob
文件下载乱码 前端解决方案
export function GetDownload (obj) { //乱码配置下载
return request({
responseType:'arraybuffer', //解决乱码配置**
url: '/xxx',
method: 'post',
data: obj
})
}
//用下载插件下载
import fileDownload from 'js-file-download';
api.GetDownload(param).then(res => {
fileDownload(res,'下载名称');
})