uploadFile上传文件失败,但是使用web端可以正常上传?
buttonHandler() { var that = this wx.chooseImage({ count: 1, sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success: function(res) { console.log(res) var tempFilePaths = res.tempFilePaths // that.setData({ // image_src: tempFilePaths // }) that.tempFilePath = tempFilePaths wx.uploadFile({ complete(res){ console.log(res) }, url: 'http://127.0.0.1:5000/test', filePath: tempFilePaths[0], name: 'test', fail: function(res){ wx.showToast({ title: '失败', duration: 1000 }) }, success: function (res) { console.log(res) var datas = JSON.parse(res.data.replace(/'/g, '"')) console.log(datas) that.setData({ image_src: datas.data.url }) that.image_src = datas.data.url } }) } }) },