在index.html中添加代码: <script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> 在其他界面输出即可: console.log(returnCitySN["cip"]) 即可打印出所在位置的公网ip 来源:https://www.cnblogs.com/helen9822/p/11921595.html 标签 搜狐