fix: align h5 dev proxy with server port

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
jesxion
2026-04-28 10:21:49 +08:00
parent d02cb71891
commit 9197417839
3 changed files with 5 additions and 5 deletions

View File

@@ -185,7 +185,7 @@ OSS_REGION=oss-cn-beijing
```dotenv
# 开发时 API 代理目标Vite 代理,不会暴露在浏览器)
DEV_API_TARGET=http://127.0.0.1:3201
DEV_API_TARGET=http://127.0.0.1:3000
# 生产部署时如需子路径,设置此项,例如 /h5/
VITE_BASE=/
@@ -213,7 +213,7 @@ npm run dev # tsx watch热重载默认监听 :3000
# 终端 2移动端 H5
cd h5-app
npm run dev # Vite dev server默认 :5173/v1 代理到 :3201(或 DEV_API_TARGET
npm run dev # Vite dev server默认 :5173/v1 代理到 :3000(或 DEV_API_TARGET
# 终端 3管理后台
cd admin-web

View File

@@ -3,10 +3,10 @@
VITE_BASE=/
# API base URL exposed to the browser bundle.
# Empty string means API calls are relative (Vite dev proxy handles /v1 → 3201).
# Empty string means API calls are relative (Vite dev proxy handles /v1 → 3000).
# Set to an absolute URL for production deployments, e.g. https://api.example.com
VITE_API_BASE=
# Proxy target for local dev server (not exposed to browser).
# Override with DEV_API_TARGET=http://host:port to point at a different backend.
DEV_API_TARGET=http://127.0.0.1:3201
DEV_API_TARGET=http://127.0.0.1:3000

View File

@@ -6,7 +6,7 @@ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const base = env.VITE_BASE || '/'
const apiTarget = env.DEV_API_TARGET || 'http://127.0.0.1:3201'
const apiTarget = env.DEV_API_TARGET || 'http://127.0.0.1:3000'
return {
base,