我正在使用另一个api,没有问题,如下所示:
fetch("https://www.boredapi.com/api/activity").then(r => r.text()).then(console.log);
但这不管用:
fetch("https://www.timeapi.io/api/Time/current/zone?timeZone=Brazil/East").then(r => r.text()).then(console.log);
通过上面的代码,我得到了一个空白的响应:(
发布于 2022-05-15 17:42:40
这将返回cors错误。
您可以使用后端下载数据或使用代理。
https://stackoverflow.com/questions/72250589
复制相似问题