|
|
hai 8 meses | |
|---|---|---|
| .. | ||
| app | hai 8 meses | |
| components | hai 8 meses | |
| features | hai 8 meses | |
| lib | hai 8 meses | |
| public | hai 8 meses | |
| utils | hai 9 meses | |
| .env.local.example | hai 9 meses | |
| .gitignore | hai 9 meses | |
| README-配置说明.md | hai 8 meses | |
| README.md | hai 11 meses | |
| components.json | hai 8 meses | |
| eslint.config.mjs | hai 11 meses | |
| next.config.ts | hai 8 meses | |
| package-lock.json | hai 8 meses | |
| package.json | hai 8 meses | |
| postcss.config.mjs | hai 11 meses | |
| tsconfig.json | hai 11 meses | |
.env.local 文件在 frontend 目录下创建 .env.local 文件(如果不存在)。
在 .env.local 文件中添加以下内容:
# 将 192.168.124.9 替换为你的电脑 IP 地址
# 获取 IP 地址:在 PowerShell 中运行 ipconfig
NEXT_PUBLIC_API_BASE_URL=http://192.168.124.9:8080
你的 IP 地址:根据 ipconfig 结果,你的 IP 地址是 192.168.124.9
# 停止当前服务(Ctrl+C)
# 重新启动
npm run dev
http://192.168.124.9:3000如果只想在本地开发,不需要配置 .env.local 文件,使用默认配置即可:
http://localhost:3000http://127.0.0.1:80800.0.0.0:8080,允许外部访问Windows PowerShell:
# 在 frontend 目录下运行
@"
NEXT_PUBLIC_API_BASE_URL=http://192.168.124.9:8080
"@ | Out-File -FilePath ".env.local" -Encoding utf8
(记得将 192.168.124.9 替换为你的实际 IP 地址)