19 lines
1.2 KiB
JavaScript
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.

// 生产接口根地址:所有 production 构建(electron 打包 / Android 打包)统一指向生产域名,
// 避免构建机上残留的 .env.local 测试地址被带进生产包
const PROD_API_BASE = 'https://qimen.wms.gztbyc.com'
// 构建期「显式」指定的接口地址(真机调试用):
// 只有从命令行环境变量注入 VITE_API_BASE_OVERRIDE 才生效——该变量不写入任何 .env 文件,
// 所以即使构建机上存在带开发地址的 .env.local,生产打包也不会被它影响(见 scripts/build-apk.cjs 的地址校验)。
// 注入方:npm run dev:adb(默认取 .env.local 的地址,可用 --prod-api 关闭)。
const overrideApiBase = import.meta.env.VITE_API_BASE_OVERRIDE || ''
// 开发环境地址走 Vite 环境变量(见 .env.example / .env.local,敏感地址勿提交 git)
export const BASE_URL = overrideApiBase
? overrideApiBase
: import.meta.env.PROD
? PROD_API_BASE
: import.meta.env.VITE_API_BASE_URL || '' // 接口根地址,开发时由 .env.local 注入
export const API_URL = `${BASE_URL}/system` // 后台接口域名
export const IMG_URL = import.meta.env.VITE_IMG_URL || 'https://ye4s.file.gzxunren.com' // 全局网络图片地址变量,css背景图片地址变量在uni.scss