xinli/项目介绍/环境配置/app环境配置
2026-01-30 16:23:00 +08:00

33 lines
840 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

我看到问题了!前端服务运行在 127.0.0.1:80这意味着
端口是 80不是 8090 - App 配置的是 8090 端口
只监听 127.0.0.1 - 这意味着只能本机访问,手机无法访问
需要修改前端配置,让它监听所有网络接口。让我查看前端的配置文件:
Read file(s)
vue.config.js
找到问题了vue.config.js 中配置的是:
host: '127.0.0.1' - 只监听本机
port: 80 - 端口是 80
需要修改为监听所有网络接口,并且 App 中的端口也要对应。有两个方案:
方案1修改前端配置监听所有接口
Accepted edits to
vue.config.js
现在修改 App 中的端口为 80与前端配置一致
Accepted edits to
MainActivity.java
现在需要:
重启前端服务 - 停止当前的 npm run dev然后重新运行
重新打包 App