let imgUrl = 'http://scrm-oss-new-pub.oss-cn-shenzhen.aliyuncs.com//aaa9b48acedee94e27a2734b284a40f7'
function loadImg(url) {
let img = new Image()
img.src = url
return new Promise((resolve, reject) => {
img.onload = () => {
resolve(url)
}
img.onerror = (e) => {
reject(e)
}
})
}
loadImg(imgUrl)
.then(res=>{
console.log(res); // 此图片能加载
})
.catch(error=>{
console.log(error); // 此图片不能加载
})