科尔多瓦Android无法执行GET请求

时间:2019-05-13 11:17:43

标签: android cordova

我正在使用Cordova,Nuxt JS和Axios执行GET请求。

我使用Cordova的GET请求在Android上返回this.axios.get('http://jsonplaceholder.typicode.com/posts/') .then(function(response) { self.tomData = response }) .catch(function(error) { self.error = true self.errorText = error }) ,但在浏览器以及iOS模拟器和iOS物理设备上都能正常使用。我的GET请求是:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.team8digital.ddpro" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>ddproMonitor</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <splash src="res/splash/ios/Default@2x~universal~anyany.png" />
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <plugin name="cordova-plugin-background-mode" spec="https://github.com/katzer/cordova-plugin-background-mode.git" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <engine name="android" spec="^8.0.0" />
    <engine name="ios" spec="^5.0.1" />
    <engine name="browser" spec="^6.0.0" />
</widget>

我正在使用Cordova 8.0.0。我尝试过HTTPS和HTTP,也尝试过其他域。

有什么建议吗?

更新

安装白名单插件后,仍然出现错误,我的config.xml是:

{{1}}

0 个答案:

没有答案