为什么修改不了哪儿出问题了

//修改service
int update(Author author);

//修改 serviceImpl
@Override
@Transactional
public int update(Author author) {
return authorMapper.updateByPrimaryKey(author);
}
//修改controller
@PutMapping("update")
public ResponseEntity update(Author author){
int count=service.update(author);
System.out.println(count);
if(count>0){
return new ResponseEntity<>("修改成功",HttpStatus.OK);
}else {
return new ResponseEntity<>("修改失败",HttpStatus.BAD_REQUEST);
}
}

id:
修改姓名: 修改 //根据id查询赋值 function selectId(id){ $.ajax({ url:"../author/"+id, type:"GET", success:function (author) { $("#a_id").val(author.aid); $("#a_name").val(author.aname); } }); } //修改 $("#btn").click(function () { //获得表单数据 var form=$("#form_add").serialize(); //发送ajax请求 $.ajax({ url:"../../author", type:"PUT", date: form, success:function (response) { console.log(response) } }); });

调试一下看进你的update方法没有,再你这个有没有值,是不是值传的有问题,再看看后台有没有报错

img

首先你看JAVA的更新方法中能不能获取到值