在redux状态下,出现了“意外输入已被给予规范化”错误消息

时间:2018-07-06 12:03:02

标签: reactjs redux

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",
});

状态: enter image description here

0 个答案:

没有答案