@CrossOrigin(allowCredentials="true", allowedHeaders="*", methods={RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE, RequestMethod.OPTIONS, RequestMethod.HEAD, RequestMethod.PUT, RequestMethod.PATCH}, origins="*") @RequestMapping(value="/save",method={RequestMethod.POST}) public String save(@RequestBody PostColumn entity) { String json = tableService.save(entity.getSchame(),entity.getTablename(),entity.getColumnname(),entity.getRemark()); logger.info(json); return json; }
这里一定要在实体类之前加上@RequestBody