Angular 4应用程序托管在https://192.168.1.104:xxxx上,并通过提供基本身份验证凭据进行访问。
以下代码片段用于读取美国各州边界坐标的JSON文件,并使用D3绘制它们。
D3.json("/assets/topojson/us.json", function (error, us: any) {
self.mapUSGroup.append("path")
.attr("class", "state")
.datum(Topojson.feature(us, us.objects.states))
.attr("d", self.projectionPath);
});
它在Firefox上使用时读取文件但在Chrome上它会出现以下控制台错误并再次请求身份验证。
GET https://null:[email protected]:20043/assets/topojson/us.json 401 (Unauthorized)
它在Angular 2上工作正常。它适用于外部IP。
我错过了什么吗?
它似乎与"HTTP Basic Authentication credentials in Google Chrome 64 not transfered to AJAX calls in d3.js"有关
哪个州
从谷歌Chrome 64开始,它在URL中处理基本身份验证凭据方面有一些变化。