java-web - Why can't HBuilder real-machine debugging request the locally running java background project interface?
大家讲道理
大家讲道理 2017-05-27 17:40:33
0
1
933

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!+请求失败")
                }
            });
  1. 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.

  2. 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?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
刘奇

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template