The ArcGIS Server service we publish on the computer is easy to access on the computer with localhost, and the image is easy to access via IP: port number. However, when the project was thrown into Tomcat, and then in the same intranet access, the phone side of the picture can not come out, like the following, why??
Is the computer side:
Is the phone side:
You can see a blank on the phone side, why? Below Open browser F12 analysis,
We can see that some of the files that we set up by IP address are still accessed through IP addresses, but look down:
From here, all the files are requested by localhost, which is why the mobile phone can not get the resource, the phone-side request "localhost" is the phone itself, which involves how to access all resources through the IP address problem. When I found Tomcat was just starting to set up, Tomcat was fine, what was the problem??
In the settings of the GIS API , when we configured local access to the GIS API, it was set to "localhost", where only two files were changed:
\gisapi\arcgis_js_api\library\3.16\3.16\init.js, change the localhost in this file to an IP address,
Change gisapi\arcgis_js_api\library\3.16\3.16\dojo\dojo.js to the IP address of localhost under this directory.
Reboot Tomcat (I configured two Tomcat, one to serve the GIS API, the other for my project, although a tomcat might be enough, but to avoid unnecessary conflicts in the future, as I did), look at the request. Web-side requests, we see that all the files in the GIS API are accessed through the IP address.
Let's look at the phone case: OK.
Tip: If you need to collapse device access, it is best to set all "localhost" to an IP address. Although a bit stupid, the IP address changes when you want to reset many files in the IP address, but this can be achieved through equipment access, do not know if there is a more appropriate way to welcome the great God in the comments to my message ~ ~ "Original, reproduced please indicate the source! 】
The ArcGIS Server service published by your mobile Web page does not show problems with the map