WMS_PDA/.env.example
liufumingren ba33f9c59a fix(env): 生产地址防呆,避免开发地址打进正式包
- src/env.js:生产构建固定 PROD_API_BASE,开发地址只从 .env.development.local 注入,源码不再保留内网地址字面量
- 新增 scripts/check-build-env.cjs:扫描产物含内网地址或缺生产域名即中止构建,已挂到 build:h5 / build:app-plus,另有 npm run check:env
- 新增 .env.example 模板;开发变量改用 mode 专属的 .env.development.local(.env.local 在 production 模式也会被加载并注入客户端代码)
- README 补充接口地址与环境变量防呆说明
2026-10-02 20:17:23 +08:00

12 lines
791 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.

# 环境变量模板:复制为 .env.development.local 并填写真实值(该文件不提交 git)
#
# 生效范围:仅 NODE_ENV=development 的构建(npm run dev:h5 / dev:app-plus)
# 发布构建(npm run build:h5 / build:app-plus)固定使用 src/env.js 中的
# PROD_API_BASE,不会读取本文件的地址,详见 src/env.js 顶部说明。
#
# ⚠️ 不要用 .env.local:它在 production 模式同样会被加载,并会被构建工具注入到
# 客户端代码里,导致内网地址出现在正式包中(scripts/check-build-env.cjs 会中止构建)。
# ⚠️ 不要把 VUE_APP_API_BASE_OVERRIDE 写进 .env* 文件:它只允许由命令行显式注入。
VUE_APP_API_BASE_URL=http://your-server-ip:6060
VUE_APP_IMG_URL=https://ye4s.file.gzxunren.com