`{
url: ‘xxxxxxxx’,
data: data,
responseType: ‘blob’, // 接收文件必要参数(重点参数)
mimeType: ‘text/plain; charset=x-user-defined’, // 处理pdf文件空白页的问题(重点参数)
success: callbackSuc,
error: callbackErr
}
let length = res.length; // res为获取到的文件流
let array = new Uint8Array(new ArrayBuffer(length));
for (let i = 0; i < rawLength; i++) { // 转化为可用的pdf流
array[i] = res.charCodeAt(i) & 0xff;
}
let blob = new Blob([array],{type: ‘application/pdf;charset-UTF-8’}); // 生成前端可用的blob对象`