uni-app Post springboot 后台接收数据为null 解决办法


方法一:
@RequestMapping(value = "getSjyzm.interface", method = RequestMethod.POST)
@ResponseBody
public Object getSjyzm(HttpServletRequest request, Yzm yzm) {

uni.request({
url: url,
data: formdata,
method: "POST",
dataType: ‘json‘,
header: {
‘Content-type‘:‘application/x-www-form-urlencoded‘
//"content-type":"application/json"
// "Access-Control-Allow-Origin": ‘*‘
},
success: (e) => {


方法二:
@RequestMapping(value = "getSjyzm.interface", method = RequestMethod.POST)
@ResponseBody
public Object getSjyzm(HttpServletRequest request, @RequestBody Yzm yzm) {

uni.request({
url: url,
data: formdata,
method: "POST",
dataType: ‘json‘,
header: {
//‘Content-type‘:‘application/x-www-form-urlencoded‘
"content-type":"application/json"
// "Access-Control-Allow-Origin": ‘*‘
},
success: (e) => {

 

uni-app Post springboot 后台接收数据为null 解决办法

上一篇:BIOS设置密码之后忘记了怎么办?


下一篇:Jenkins+Gradle实现Android移动端自动打包+邮件发送通知