如果java后台通过URLEncoder.encode(data,"UTF-8")方法将data字符串进行了编码后再返回给前台,
小程序获取到这个字符串的时候需要调用decodeURIComponent进行解码
wx.request({
url: url,//后台接口url
data: {},//需要传递的参数,json格式
success: function(res) {
console.log('success:')
var a = decodeURIComponent(res.data)
var json = JSON.parse(a);
console.log(json);
},
})