移动端项目本地调试,手机访问mac电脑localhost网页
2018-09-20 本文已影响0人
leo0oel
【配置步骤】
1.0 检查电脑防火墙是否关闭:


2.0 让 mac和手机连接到同一局域网内,比如公司wifi,或者流量用不完的童鞋可以手机开热点让mac去连接。
3.0 我们通过在终端敲出命令> ifconfig 即可找到wifi的ip地址,也可以通过打开网络偏好设置里查看ip,截图如下:

4.0 一般情况下,我们手机就可以用着个查出来的ip来访问电脑上的localhost网页了,链接形式如下:
http://localhost:8080/leo.com ---->>> http://10.100.107.1xx:8080/leo.com
【注意注意】
很容易忽视的一点,如果出现链接不成功的情况下,检查config/index.js文件里的host配置有没有被你改成其他的,这里必须是loclhost或者你的局域网ip:

好了,到这里,基本就会成功了的~
顺祝调试愉快^_^