feat(custom): 多API版本
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-23 18:24:41 +08:00
parent 5e32c846c7
commit d5751d305c
13 changed files with 336 additions and 47 deletions

View File

@@ -13,6 +13,13 @@ export default defineConfig(({ command, mode }) => {
const viteEnv = convertEnv(env)
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_USE_PROXY, VITE_BASE_API, VITE_SENTRY } = viteEnv
// 调试代理配置
console.log('=== Vite代理配置调试 ===')
console.log('VITE_USE_PROXY:', VITE_USE_PROXY)
console.log('VITE_BASE_API:', VITE_BASE_API)
console.log('PROXY_CONFIG:', PROXY_CONFIG)
console.log('所有环境变量:', viteEnv)
return {
base: VITE_PUBLIC_PATH || '/',
resolve: {
@@ -26,12 +33,10 @@ export default defineConfig(({ command, mode }) => {
host: '0.0.0.0',
port: VITE_PORT,
open: false,
proxy: VITE_USE_PROXY
? {
[VITE_BASE_API]: PROXY_CONFIG[VITE_BASE_API],
'/api/v2': PROXY_CONFIG['/api/v2'],
}
: undefined,
proxy: {
'/api1': PROXY_CONFIG['/api1'],
'/api': PROXY_CONFIG['/api'],
},
},
build: {
target: 'es2015',