wx.getImageInfo
读取本地文件报错:
wx.getImageInfo({
src: '../images/common/youmaipaigongzhonghao.png',
success(res) {},
fail(err) {console.log(err)}
});
错误日志:{errMsg: "getImageInfo:fail file not found"}
错误原因:src 路径不对,images
路径前不应该加..
修改如下:
wx.getImageInfo({
src: '/images/common/youmaipaigongzhonghao.png',
success(res) {},
fail(err) {}
});