Ionic framework Ionic4 http请求在Android设备上不工作

Ionic framework Ionic4 http请求在Android设备上不工作,ionic-framework,ionic4,Ionic Framework,Ionic4,到目前为止,RESTAPI get方法在我的本地ng服务中工作,但在我的设备中不工作 Android设备远程调试显示:URL:'localhost/get/list' proxy.config.json "/code":{ "target": "http://192.x.x.x:8010", "secure":false, "changeOrigin": true, "logLevel": "debug" },

到目前为止,RESTAPI get方法在我的本地ng服务中工作,但在我的设备中不工作

Android设备远程调试显示:URL:'localhost/get/list'

proxy.config.json

"/code":{   
        "target": "http://192.x.x.x:8010",   
        "secure":false,
        "changeOrigin": true,
        "logLevel": "debug"
    },
序列获取方法:

      this.service.getUrl('/get/list','level=2').subscribe(
        data=>{ //Android Device URL :localhost/get/list not showing proxy.config.url

});
package.json

"start": "ng serve   --proxy-config proxy.conf.json",
远程调试结果:**我无法获得**\u body与本地结果类似的结果,它似乎正在获取index.html页面

本地ng服务结果:

如果您使用的是emulator,且API位于本地计算机上,请将
proxy.config.json
中的IP地址更改为
10.0.2.2
。查看

您是在模拟器中运行还是在实际的手机上运行?实际的手机以及模拟器您是如何托管API的?谁在上菜?它是否配置为允许外部连接?10.0.2.2在模拟器上工作吗?IP:10.0.2.2未连接成功,需要从外部配置IP(192.X.X.X:8080)8080是否对外开放?您使用的服务器配置为允许外部连接吗?