项目启动优化

This commit is contained in:
2026-05-09 17:04:58 +08:00
parent 4315f556c6
commit 8904cc8868
3 changed files with 60 additions and 20 deletions
+4 -2
View File
@@ -2,6 +2,8 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET || 'http://127.0.0.1:18080'
export default defineConfig({
plugins: [vue()],
resolve: {
@@ -12,9 +14,9 @@ export default defineConfig({
port: 5173, // 你的端口号
proxy: {
'/api/v1': {
target: 'http://localhost:18080',
target: apiProxyTarget,
changeOrigin: true
}
}
}
})
})