Cordova白名单不允许访问我的服务器


Cordova WhiteList does not allow access to my Server

我无法连接到数据库,因为我的URL被拒绝了。我想要访问的url是:

http://192.168.0.16/checkUser.php?nombre=asi&劈开= 1234

我有一些相同结构的url,我在config.xml文件中尝试过,但没有工作。

<access origin="*" />
<access origin="http://192.168.0.16" subdomains="true" />

<access origin="http://192.168.0.16/*"/>

这是完整的代码,我创建的路径和调用函数连接到我的数据库:

function pullUser(userName,apodo,secondName,lastName,pass1,userMail){
    var method='GET';
    var url = appConstants.requestpullUserURL();
    //alert('cogidaUrl: '+ url);
    var path = url + "?nombre="+userName+"&apodo="+apodo+"&apellido1="+secondName+
    "&apellido2="+lastName+"&email="+userMail+"&clave="+pass1;
    console.log(path);
    //alert('El path es: '+ path);
    var xhr = new XMLHttpRequest(); 
    xhr.onreadystatechange = function(){
        //alert('onready. readyState:'+xhr.readyState+' status: '+xhr.status);
        if(xhr.readyState == 4 && xhr.status == 200){
            resp = xhr.responseText;
            //alert('Registro completado');
            transitionLog();
            }else{
                //alert('devuelve false');
                return false; 
            }
    }
    xhr.open(method, path, true); //Creamos la peticion
    resp = xhr.send(); // FALLA AQUI SIN SERVER
    alert('despues del send');
}

谢谢。

我解决了它,添加了白名单插件。我不知道为什么当我创建项目没有添加自己。这个bash代码在我的应用程序目录解决了这个问题: