let url = '' //接口地址
// 先把文件流地址转为blob类型
var request = new XMLHttpRequest();
request.open('GET', url, true);
request.responseType = 'blob';
request.onload = function(res) {
// 把blob转为File类型
const file = new window.File(
[res.currentTarget.response], // blob
'Filename',
{ type: res.currentTarget.response.type }
);
};