rwadurian/frontend/mining-admin-web/src/lib
hailin 59efdb1f78 fix(mining-admin-web): 修复 API 请求超时和路由问题
问题:
- mining-admin-web 容器与后端服务在不同 Docker 网络, 无法通过公网 IP 回连 (hairpin NAT 失败)
- next.config.js 生产模式强制走 mapi.szaiai.com Kong 网关, 容器内无法访问
- client.ts 使用 NEXT_PUBLIC_API_URL 导致外部 URL 被 build 时内联到客户端包
- mining-service controller 有 mining/ 前缀, 直连模式 rewrite 丢失该前缀

修复:
- next.config.js: 改用 API_GATEWAY_URL 判断路由模式, 未设置则直连后端服务
- next.config.js: mining rewrite 保留 mining/ 前缀匹配 controller 路由
- client.ts: baseURL 固定为 /api, 所有请求统一走 Next.js rewrite 代理
- docker-compose.2.0.yml: 添加 TRADING_SERVICE_URL 和 MINING_SERVICE_URL 环境变量

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 01:14:19 -08:00
..
api fix(mining-admin-web): 修复 API 请求超时和路由问题 2026-02-02 01:14:19 -08:00
constants feat(mining-admin-web): 前端实现区域代码到中文名称转换 2026-01-21 05:20:50 -08:00
hooks feat(mining-ecosystem): 添加挖矿生态系统完整微服务与前端 2026-01-10 17:45:46 -08:00
utils style(mining-admin-web): display all numbers with 8 decimal places 2026-01-15 02:55:23 -08:00
utils.ts feat(mining-ecosystem): 添加挖矿生态系统完整微服务与前端 2026-01-10 17:45:46 -08:00