Files
alert/config/proxy.ts
Jhonton Chen dfcba94cf5 feat(platform): add platform access control with quota management
- Add userPlatform hook to derive available platforms from company config
- Add platform access section in company popup with MT4/MT5 switch and quota limits
- Add platform access column in company list showing quota usage
- Replace hardcoded platform options with dynamic userPlatform in account/alert/data-source pages
- Add getPlatformList API and extend CompanyListItem typings
- Add i18n translations for platform access related keys
- Update dev proxy target port to 8082

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-12 17:57:25 +08:00

55 lines
1.7 KiB
TypeScript

/**
* @name Proxy configuration
* @see In the production environment, the proxy cannot take effect, so there is no configuration of the production environment
* -------------------------------
* The agent cannot take effect in the production environment
* so there is no configuration of the production environment
* For details, please see
* https://pro.ant.design/docs/deploy
*
* @doc https://umijs.org/docs/guides/proxy
*/
export default {
// If you need to customize the local development server, please uncomment and adjust as needed.
dev: {
'/api': {
// The address to proxy
// target: 'http://2333z061l7.51mypc.cn',
// target: 'http://172.20.177.121:8080',
target: 'http://172.20.177.121:8082',
changeOrigin: true,
pathRewrite: {
'^/api': '',
},
// xfwd: true,
onProxyRes: (proxyRes: any, req: { url: string | string[] }) => {
// Tell the browser/proxy not to cache streaming data
if (req.url?.includes('/sse')) {
// Key setting: instruct the browser/proxy not to cache streamed data
proxyRes.headers['Cache-Control'] = 'no-transform';
// For upstream proxies like Nginx, disable buffering (hard to verify effect; set as a precaution).
proxyRes.headers['X-Accel-Buffering'] = 'no';
}
},
},
},
/**
* @name Detailed proxy configuration
* @doc https://github.com/chimurai/http-proxy-middleware
*/
test: {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
'/api': {
target: 'https://proapi.azurewebsites.net',
changeOrigin: true,
},
},
pre: {
'/api/': {
target: 'your pre url',
changeOrigin: true,
},
},
};