Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x9152780 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
報錯信息如上播揪,加上
manager.requestSerializer = [AFHTTPRequestSerializer serializer];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
依然沒有用,讓后臺看看他寫的方法,
遇到后臺這樣寫有問題
/**
* 信息
*/
@ResponseBody
@RequestMapping("/info/{id}")
@RequiresPermissions("wy:fieldappointment:info")
public R info(@PathVariable("id") Long id){
WyFieldAppointmentEntity wyFieldAppointment = wyFieldAppointmentService.queryObject(id);
return R.ok().put("data", wyFieldAppointment);
}
改成下面下面這樣就沒有問題
/**
* 信息
*/
@ResponseBody
@RequestMapping(value="/info",method = RequestMethod.GET)
public R info(Long id){
WyFieldAppointmentEntity wyFieldAppointment = wyFieldAppointmentService.queryObject(id);
return R.ok().put("data", wyFieldAppointment);
}