1. Why can’t HBuilder real-machine debugging request the locally running Java background project interface?
2. The front end uses the mui framework to generate the real-machine test app and request the locally running Java background project.
mui.ajax( 'http://192.168.1.124:8080/tes...',{
//mui.ajax('http://localhost:8080/test/de...',{
data:'',
async:true,
dataType:'json',
type:'post',
success:function(list){
console.log(list);
console.log(JSON.stringify(list));
},
error:function(){
console.log("Damn it!+请求失败")
}
});
When the page is requested, ajax cannot request the background interface? Even if both addresses are written in the same way, it won’t work??
Note: If you run the background project on another computer, you can send requests.
Hbuilder and the tomcat port running in the java background are on the same computer. There is no conflict. Why can't it be requested?
localhost refers to the local machine. For mobile phones, it is the mobile phone itself and not your PC, so you cannot access the interface on your PC