通过wx.cloud.downloadFile获得了临时文件路径传不出去,怎么办?控制台可以看到
res.tempFilePath已经成功获得值了,但是我想赋值给writepath怎么都不成功,输出都是undefine是为什么。大神给个正确的代码建议
wx.cloud.init() wx.cloud.downloadFile({ fileID: 'cloud://shufa-8rvqy.7368-shufa-8rvqy/sj.ttf' , success: res => { // get temp file path console.log( '米芾success' +res.tempFilePath) that.setData({ writepath: res.tempFilePath }) writepath: res.tempFilePath console.log( '米芾successwritepath' + that.writepath) }, fail: err => { // handle error console.log(res.err) } }) |
48行 that.data.writepath