前端请求时header中设置 contentType : ‘application/json’。
wx.request({ url: ‘http://localhost:8080/send/add2‘, method:‘POST‘, header: { "Content-Type": "application/json", "userId": id }, data:{ }, success(res){ }, fail(){ } })
原文:https://www.cnblogs.com/150536FBB/p/14606518.html