AppID(小程序ID): wx3fd730ac1e1a9003
async uploadAvatar() {
let upToken = await this.getQiniuToken()
let that = this
wepy.chooseImage({
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
count: 9
}).then(res => {
let tempFilePaths = res.tempFilePaths
tempFilePaths.forEach(function (item, index) {
wx.getFileSystemManager().readFile({
filePath: item,
success: res => {
let Buffer = res.data
wx.cloud.callFunction({
name: 'ContentCheck',
data: {
img: Buffer
},
success(res) {
if(res.result.errCode === 87014){
Toast('图片违规!')
return false
} else {
if (upToken) {
wepy.showLoading({
title: '正在上传...'
})
qiniuUploader.upload(
item,
qiniuRes => {
wepy.hideLoading()
if (that.myPublishList.affordNeedImg.length < 9) {
that.myPublishList.affordNeedImg.push(qiniuRes.imageURL)
that.$apply()
}
wepy.showToast({
title: `上传图片成功`,
icon: 'none'
})
},
error => {
console.log(error)
wepy.hideLoading()
wepy.showToast({
title: `error: ${JSON.stringify(error)}`,
icon: 'none'
})
},
{
region: 'ECN',
uptoken: upToken,
key: `GShangxie/${new Date().getTime()}.png`,
uploadUrl: 'https://up.qiniup.com',
domain: 'https://htpic.fangxie365.com'
}
)
}
}
}
})
}
})
})
})
},
云调用改HTTPS调用 已解决
你好,真机返回的err是什么呢?