ajax 前后台交互
前台:
$.ajax({
url:prefix + "/isOrigin",
type: "POST",
data:{id:id},
success:function(result){
alert(result.isOrigin);
}
})
后台:
@PostMapping("/isOrigin")
@ResponseBody
public Result isOrigin(String id) {
Result result = new Result();
if(zbEquipmentService.isOriginEquipment(id)){
result.put("isOrigin", true);
}else{
result.put("isOrigin", false);
}
return result;
}