原创

com.alibaba.fastjson 前台传JSONObject 后台转为Map

@ResponseBody
@RequestMapping(value = "/basic/xxxx", method = RequestMethod.POST)
public ReturnResult xxxx(HttpServletRequest req, HttpServletResponse resp,
@RequestBody JSONObject params) {
Map<String, Object> map = JSONObject.parseObject(params.toJSONString(), new TypeReference<Map<String, Object>>(){});
return ReturnResult.success();
}
正文到此结束
Loading...