React + redux中的操作有错误-收到响应后的应用程序 前端ReactJS,后端Java。使用fetch收到响应后,我收到错误消息:
错误:提供了意外的输入以进行规范化。预期类型为 “对象”,找到“未定义”。
@RequestMapping(value = {"/overtimes/divisions"}, method = RequestMethod.GET)
public List getAllDivisions(HttpServletRequest request, HttpServletResponse response) {
List<Payment> res = new ArrayList<>();
res.add(new Payment());
return res;
}
前端api
export const fetchDivisions = () => invokeGetDivisions()
.then(throwHttpErrors)
.then(response =>
response.json(),
);
const invokeGetDivisions = () => fetch("/rest/overtimes/divisions", {
headers: {
Accept: "application/json",
"Content-Type": "application/json;charset=UTF-8",
},
method: "GET",
credentials: "same-origin",
});