我正在使用 React js ( Admin on Rest ) 进行 API 调用 (GET )。
当我调用 localhost:5001/cites 时,我已经检查了 API 服务器,服务器返回了城市数据,但我不知道它在客户端出错,这是来自浏览器的日志:
failure.js:18 Error: The X-Total-Count header is missing in the HTTP Response. This header is necessary for pagination. If you are using CORS, did you declare X-Total-Count in the Access-Control-Allow-Headers header?
at convertHTTPResponseToREST (http://localhost:3000/static/js/bundle.js:33928:28)
at http://localhost:3000/static/js/bundle.js:33966:21
和
failure.js:18 Error: The Content-Range header is missing in the HTTP Response. This header is necessary for pagination. If you are using CORS, did you declare Content-Range in the Access-Control-Allow-Headers header?
at convertHTTPResponseToREST (http://localhost:3000/static/js/bundle.js:33010:28)
at http://localhost:3000/static/js/bundle.js:33037:21
有人可以帮忙吗?谢谢