安卓真机有几款机型直接走onerror,IOS真机和开发者工具正常,是兼容问题吗?
//JS加载图片类,
const loadImage = (canvas,src) => {
return new Promise((ok,fail) => {
let interval = null;
let seal = new Image();
// let seal = canvas.createImage();
seal.setAttribute("crossOrigin",'anonymous');
seal.onload = (res) => {
// alert('in loading图片加载完成:' + src);
ok(seal)
}
seal.onerror = err => {
ok(false)
}
seal.src = src;
})
}