前端下载不同源图片方法
记录前端下载不同源图片方法
前台js部分
function down() {
let url = 请求后台地址+拼接参数;
let xhr = new XMLHttpRequest();
xhr.open(‘GET’, url, true);
xhr.responseType = “blob”;
xhr.setRequestHeader(“client_type”, “DESKTOP_WEB”);
xhr.onload = function() {
if (this.status == 200) {
let
原创
2020-05-20 14:25:39 ·
1301 阅读 ·
0 评论