之前碰到跨域问题,后端设置header即可
header("Access-Control-Allow-Origin: * ");
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
这次设置后还是报错
Access to XMLHttpRequest at 'http://172.27.XX.XX/api/push/getEventDetail?id=1' from origin 'http://www.XXX.com' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space `private`.
通过stackoverflow上的文章,跨域报错,暂时解决
image.png