fix: dev 代理全部路径统一静默处理服务启动窗口期的连接错误
- /uploads、/t、/trace 代理补 onProxyError,目标未就绪时返回 503 由前端重试
This commit is contained in:
@@ -59,9 +59,9 @@ export default defineConfig({
|
|||||||
// 生产由 API 单端口托管全部路径,短链 {BASE_URL}/t/xxx 天然可用;此处让本地行为对齐。
|
// 生产由 API 单端口托管全部路径,短链 {BASE_URL}/t/xxx 天然可用;此处让本地行为对齐。
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': { target: 'http://localhost:3000', changeOrigin: true, configure: onProxyError },
|
'/api': { target: 'http://localhost:3000', changeOrigin: true, configure: onProxyError },
|
||||||
'/uploads': { target: 'http://localhost:3000', changeOrigin: true },
|
'/uploads': { target: 'http://localhost:3000', changeOrigin: true, configure: onProxyError },
|
||||||
'^/t/.*': { target: 'http://localhost:3000', changeOrigin: true },
|
'^/t/.*': { target: 'http://localhost:3000', changeOrigin: true, configure: onProxyError },
|
||||||
'/trace': { target: 'http://localhost:5174', changeOrigin: true, ws: true },
|
'/trace': { target: 'http://localhost:5174', changeOrigin: true, ws: true, configure: onProxyError },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
|||||||
Reference in New Issue
Block a user