项目启动优化
This commit is contained in:
+4
-2
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user