wx.getFriendCloudStorage({
keyList: ['xxx'],
success: res => {
let arr= res.data
//以下为图片加载代码
loadNext()
var rArr=[]
function loadNext(i){
var image = wx.createImage();
var src = arr[i];
if (typeof (arr[i]) == "object"||typeof (arr[i])==Object)src=arr[i].avatarUrl
image.src = src;
image.onerror = function(){
image.src = 'images/defaultAvatar.png'
rArr.push(image)
i++
if (i == arr.length) {
if(callback) callback(rArr)
return;
}
loadNext(i)
}
image.onload = function () {
rArr.push(image)
i++
if (i == arr.length) {
if(callback)callback(rArr)
return;
}
loadNext(i)
}
}
}
})
错误:"https://wx.qlogo.cn/mmopen/vi_32/Qxxxxxxxxxxx" 不在后台可信域名中
你好,可参考下文档的规则说明:https://developers.weixin.qq.com/minigame/dev/guide/open-ability/open-data.html