Android阻止API调用localhost

时间:2018-03-06 03:52:49

标签: android cordova ionic-framework

iOS和浏览器API调用工作正常,但Android模拟器会阻止/删除API网址并阻止对localhost的调用。生产HTTPS服务器上的调用工作正常。

CORS已经实施并正在处理每个HTTP请求。

enter image description here

如何在Cordova Android 6.3.0和Ionic 3.19上允许调用非HTTPS localhost?

我在config.xml中允许以下内容

 <allow-navigation href="http://*/*" />

1 个答案:

答案 0 :(得分:0)

你在运行离子cordova模拟 - 地址localhost吗?

Ionic做出一些网络假设。

您是否安装了https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/