canvas绘制微信头像 显示暂时无法查看,已经配置过downloadFile合法域名,求指导?
点击保存生成canvas图片,
代码如下:直接使用getImageInfo,直接使用downloadFile和两者结合使用均出现下图情况。如果不把头像单独存到服务器中应该怎么处理呢?
uni.downloadFile({ url: userImg, success: (ress) => { userImgPath = ress.tempFilePath uni.getImageInfo({ src: userImgPath, success: res => { console.log( '用户头像' , res) ctx.save(); _this.roundRect(ctx, 234 , 420 * scaleH, 44 , 44 , 22 , '#f7f7f7' , '#f7f7f7' ) ctx.drawImage(res.path, 234 , 420 * scaleH, 44 , 44 ) ctx.restore(); ctx.draw( true ) }, fail: () => { _this.canvasFlag = false ; uni.showToast({ title: '头像生成失败' , duration: 2000 , icon: 'none' }); } }) }, fail: () => { } }) |


