fix(mining-admin): APK下载URL指向localhost导致手机无法下载

问题:FileStorageService 默认 UPLOAD_BASE_URL 为 http://localhost:3020/downloads,
手机端无法访问服务器的 localhost。

修复:
- docker-compose.2.0.yml: 添加 UPLOAD_BASE_URL=https://rwaapi.szaiai.com/mining-admin/downloads
- 添加 mining-admin-uploads volume 持久化上传的 APK 文件
- 修正默认端口 3020→3023(mining-admin-service 实际端口)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-30 12:56:40 -08:00
parent 94d4524ee3
commit 6900905475
2 changed files with 10 additions and 1 deletions

View File

@ -158,6 +158,11 @@ services:
TRADING_SERVICE_URL: http://trading-service:3022
AUTH_SERVICE_URL: http://auth-service:3024
JWT_SECRET: ${ADMIN_JWT_SECRET:-your-admin-jwt-secret-change-in-production}
# APK 下载地址前缀(通过 Kong 网关 /mining-admin 路由访问)
UPLOAD_BASE_URL: https://rwaapi.szaiai.com/mining-admin/downloads
UPLOAD_DIR: ./uploads
volumes:
- mining-admin-uploads:/app/uploads
ports:
- "3023:3023"
healthcheck:
@ -336,6 +341,10 @@ services:
# =============================================================================
# 网络配置 - 连接到 1.0 的网络以共享基础设施
# =============================================================================
volumes:
mining-admin-uploads:
driver: local
networks:
rwa-network:
external: true

View File

@ -20,7 +20,7 @@ export class FileStorageService {
constructor(private readonly configService: ConfigService) {
this.uploadDir = this.configService.get<string>('UPLOAD_DIR', './uploads')
this.baseUrl = this.configService.get<string>('UPLOAD_BASE_URL', 'http://localhost:3020/downloads')
this.baseUrl = this.configService.get<string>('UPLOAD_BASE_URL', 'http://localhost:3023/downloads')
// 确保上传目录存在
this.ensureUploadDir()