contentType : "application/json", //只能是這個
RequestBody 不能和form/data共存:
@RequestMapping(value = "/api/user/platform/report", method = RequestMethod.POST)
public ReturnData reportPlatform(RequestParamBean bean) { //自定義接受實體RequestParamBean
logger.info("--------------首次登陸開始----------------");
try {
bean.getDeviceFigure();
- Springboot 在接收前端實體時,可以在后端建立相應的對象來直接接受,在此可以不使用@RequestBody(只能接收josn的對象)
- @RequestPrama :接收單個字段,而非對象實體!