更改本地dev常见端口

This commit is contained in:
yml2213
2026-07-25 16:31:42 +08:00
parent dabf147019
commit 3461c02560
7 changed files with 66 additions and 33 deletions
+7 -2
View File
@@ -51,6 +51,10 @@ function stripVantRemoteIconFont() {
}
}
const frontendPort = Number(process.env.DEV_FRONTEND_PORT || process.env.PORT || 5189)
const backendPort = Number(process.env.DEV_BACKEND_PORT || 18088)
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET || `http://127.0.0.1:${backendPort}`
export default defineConfig({
// 禁止 vite 清屏,避免把后端启动日志(GIN 路由、迁移等)从终端滚动缓冲里抹掉
clearScreen: false,
@@ -74,9 +78,10 @@ export default defineConfig({
},
},
server: {
port: 5173,
port: frontendPort,
strictPort: true,
proxy: {
'/api': 'http://127.0.0.1:8080',
'/api': apiProxyTarget,
},
allowedHosts: [
'221329.cc.cd',