收藏
回答

使用wafer2 Node.js SDK 上传图片失败

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows 1.02.1805181

data: "{"code":-1,"error":"[object Object]"}"  上传图片成功后返回的结构体中没有回调图片地址

报错信息:

报错代码:

wx.chooseImage({

count: 1,

sizeType: ['compressed'],

sourceType: ['album', 'camera'],

success: function(res){

util.showBusy('正在上传')

var filePath = res.tempFilePaths[0]


// 上传图片

wx.uploadFile({

url: config.service.uploadUrl,

filePath: filePath,

name: 'file',


success: function(res){

util.showSuccess('上传图片成功')

console.log(res)

res = JSON.parse(res.data)

console.log(res)

that.setData({

imgUrl: res.data.imgUrl

})

},


回答关注问题邀请回答
收藏
登录 后发表内容