CORS跨域訪問local本地服務(wù)端資源的問題:
瀏覽器打開部署在服務(wù)器的服務(wù),訪問本地開啟的服務(wù)端資源,提示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
- 設(shè)置為Disabled辅甥,Relaunch就好了。