This commit is contained in:
Daniel
2026-03-03 20:17:38 +08:00
parent 034c088bac
commit 09ec2e3a69
20 changed files with 395 additions and 19 deletions

View File

@@ -19,8 +19,15 @@ export default defineConfig({
'/ws': {
target: 'ws://localhost:3001',
ws: true,
changeOrigin: true,
configure: (proxy) => {
proxy.on('error', () => {}) // 后端未启动时静默失败
// 抑制关标签/刷新时代理底层 socket 的 ECONNRESET避免刷屏
proxy.on('proxyReqWs', (proxyReq, req, socket, head) => {
socket?.on?.('error', () => {})
const out = (proxyReq as { socket?: { on?: (e: string, fn: () => void) => void } })?.socket
out?.on?.('error', () => {})
})
},
},
},