CORS跨域访问local本地服务端资源的问题:
浏览器打开部署在服务器的服务,访问本地开启的服务端资源,提示Access to XMLHttpRequest at 'http://localhost' from origin 'http://iot.hhf.com' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local
.
解决办法:
- 打开浏览器,进入chrome://flags/页面
- 搜索Block insecure private network requests
- 设置为Disabled,Relaunch就好了。