build(frontend): 添加不同环境的环境变量配置文件

添加开发、预发和生产环境的环境变量配置文件,包含端口、代理路径和API基地址等配置项
This commit is contained in:
2025-08-28 20:59:00 +08:00
parent 410f54a65e
commit 7c7adfe71a
11 changed files with 74 additions and 23 deletions

14
frontend/.env.production Normal file
View File

@ -0,0 +1,14 @@
# port 端口号(生产构建无效,仅用于本地预览时生效)
VITE_PORT = 8888
# 浏览器自动打开(生产构建无效)
VITE_OPEN = false
# 生产环境
ENV = 'production'
# ADMIN 服务地址(生产一般同域反代,留空)
VITE_ADMIN_PROXY_PATH =
# API 基地址(推荐同域反代,留空则 axios 使用 /api如需直连后端填写例如 https://api.example.com
VITE_API_BASE =