修復api重複

This commit is contained in:
2026-04-14 13:04:10 +08:00
parent c4a8232226
commit c48e8716ae
3 changed files with 5 additions and 15 deletions

View File

@@ -4,29 +4,19 @@ import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
server: {
host: true,
port: 3000,
host: '0.0.0.0', // 监听所有网络接口
port: 3000,
allowedHosts: 'all',
proxy: {
'/api': {
target: process.env.VITE_API_URL || 'http://localhost:33001',
changeOrigin: true,
},
},
hmr: {
host: 'performance-appraisal.excn.top', // 客户端访问的主机名
clientPort: 80, // nginx监听80端口外部代理将HTTPS 443转发到80
protocol: 'ws', // WebSocket协议nginx代理WebSocket
},
allowedHosts: 'all',
hmr: {
host: 'performance-appraisal.excn.top',
protocol: 'wss',
clientPort: 443
clientPort: 443,
},
// ❌ 直接删掉 proxy推荐
},
});