在小程序图片上传中发现返回的数据 为json字符串且 在network中Preview查看汉字为乱码
但是在console.log中正常且不乱码
在后台设置了统一返回json对象,但是前台始终显示字符串
需前端自行将字符转对象
wx.chooseImage({
success (res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://example.weixin.qq.com/upload', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'file',
formData: {
'user': 'test'
},
success (res){
const data = SON.parse(res.data)
//do something
}
})
}
})
