image加载本地缓存中svg图片失败?
首先,我先将图片通过wx.downloadFile下载到本地中,然后在通过wx.saveFile进行本地缓存,打印出的缓存地址通过小程序开发者工具可以直接打开并显示,但是image的binderror报错(GET http://store/2AhRbFtOy0Bh7e76328a2866b2a5a76bb97a3e68e289.svg 404 (Not Found)),到底什么原因,求大佬解答。 loadImg2: function (e) {
const that = this;
if (e == undefined) {
e = this.data.category0[0]
}
wx.downloadFile({
url: '在线的图片路径.svg',
success: function (res) {
const tempFilePath = res.tempFilePath;
wx.saveFile({
tempFilePath: tempFilePath,
success: function(res) {
const savedFilePath = res.savedFilePath;
that.setData({
imgUrl2: savedFilePath
}, function() {
console.log(that.data.imgUrl2);
});
}
});
}
})
},