var url = deskUrl; var $a = $("<a></a>").attr("target", "_blank").attr("href", url).attr("download", deskName+".png"); $a[0].click();js 方法,图片路径地址要对,就可以成功下载