Files
gofly-platform-services/zlt-web/react-web-next/config/proxy.ts
T
2025-12-16 11:43:37 +08:00

51 lines
1.3 KiB
TypeScript

/**
* 开发代理配置(仅 dev 生效)
* - 统一网关转发:仅代理 /api- 前缀到网关(/api-user、/api-uaa 等)
* - 生产环境由网关/容器转发,此文件不生效
*/
const GATEWAY = process.env.GATEWAY_ORIGIN || 'http://192.168.2.214:9900';
// SRS流媒体服务器地址
const SRS_SERVER = process.env.SRS_SERVER || 'http://220.205.16.27:8024';
export default {
dev: {
// 单一规则覆盖所有微服务前缀:/api-*
'/api-': { target: GATEWAY, changeOrigin: true },
// 3D模型CDN代理 - 解决跨域问题
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
// SRS WebRTC WHEP 视频流代理
'/rtc': {
target: SRS_SERVER,
changeOrigin: true,
secure: false,
},
// SRS 登录认证接口代理
'/terraform': {
target: SRS_SERVER,
changeOrigin: true,
secure: false,
},
},
test: {
'/api-': { target: GATEWAY, changeOrigin: true },
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
},
pre: {
'/api-': { target: GATEWAY, changeOrigin: true },
'/goflymodel': {
target: 'https://minicdn.goflytec.com',
changeOrigin: true,
secure: false,
},
},
} as const;