eg: https://XXXXXXXX/hdb/2021/04/13/829da7070fd74674ae41d902e40ae6c6 使用wx.getImageInfo得到的临时路径变成了txt,这个怎么处理
以下是通过wx.getImageInfo得到的信息。
{"errMsg":"getImageInfo:ok","width":221,"height":219,"type":"png","orientation":"up","path":"http://tmp/J59j2gt1hqx44755c022313019bf83f9c7ca526ffd31.txt"}"
wx.downloadFile({
url: downSrc,
filePath: wx.env.USER_DATA_PATH +'/'+filename + '111.png',
success: function (res) {}
});
可以使用wx.env.USER_DATA_PATH 来指定临时路径
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
var that = this;
var downSrc = "https://hdbbmp-dev.oss-cn-shenzhen.aliyuncs.com/hdb/2021/04/13/829da7070fd74674ae41d902e40ae6c6";
wx.getImageInfo({
src: downSrc,
success: function (res) {
wx.saveImageToPhotosAlbum({
filePath: res.path,
success:function(res) {
dialog.alert("保存成功");
},
});
}
});