From 8ed667bcf4e6788535f0b1f7c17f4da5ca959315 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 24 Feb 2026 00:18:05 -0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=81=94=E8=B0=83):=20=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=8C=87=E5=90=91=E8=BF=9C=E7=A8=8BAPI=20+=20=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E9=98=BF=E9=87=8C=E4=BA=91SMS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - genex-mobile ApiClient/UpdateService 指向 154.84.135.121:48080 - miniapp dev 环境指向 154.84.135.121:48080 - docker-compose 添加 ALIYUN SMS 环境变量透传 - auth-service 添加 @alicloud/dysmsapi20170525 等 SDK 依赖 Co-Authored-By: Claude Opus 4.6 --- backend/docker-compose.yml | 5 +++++ backend/services/auth-service/package.json | 5 ++++- frontend/genex-mobile/lib/core/network/api_client.dart | 5 ++++- frontend/genex-mobile/lib/main.dart | 4 ++-- frontend/miniapp/src/config/index.ts | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index 6dfb274..8936dde 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -512,6 +512,11 @@ services: - SMS_ENABLED=${SMS_ENABLED:-false} - SMS_CODE_EXPIRE_SECONDS=300 - SMS_DAILY_LIMIT=10 + - ALIYUN_ACCESS_KEY_ID=${ALIYUN_ACCESS_KEY_ID:-} + - ALIYUN_ACCESS_KEY_SECRET=${ALIYUN_ACCESS_KEY_SECRET:-} + - ALIYUN_SMS_SIGN_NAME=${ALIYUN_SMS_SIGN_NAME:-} + - ALIYUN_SMS_TEMPLATE_CODE=${ALIYUN_SMS_TEMPLATE_CODE:-} + - ALIYUN_SMS_ENDPOINT=${ALIYUN_SMS_ENDPOINT:-dysmsapi.aliyuncs.com} depends_on: postgres: condition: service_healthy diff --git a/backend/services/auth-service/package.json b/backend/services/auth-service/package.json index 99ff0fc..9a826f4 100644 --- a/backend/services/auth-service/package.json +++ b/backend/services/auth-service/package.json @@ -29,7 +29,10 @@ "ioredis": "^5.3.2", "kafkajs": "^2.2.4", "reflect-metadata": "^0.2.1", - "rxjs": "^7.8.1" + "rxjs": "^7.8.1", + "@alicloud/dysmsapi20170525": "^3.0.0", + "@alicloud/openapi-client": "^0.4.0", + "@alicloud/tea-util": "^1.4.0" }, "devDependencies": { "@nestjs/cli": "^10.3.0", diff --git a/frontend/genex-mobile/lib/core/network/api_client.dart b/frontend/genex-mobile/lib/core/network/api_client.dart index d08bd9a..482355b 100644 --- a/frontend/genex-mobile/lib/core/network/api_client.dart +++ b/frontend/genex-mobile/lib/core/network/api_client.dart @@ -19,8 +19,11 @@ class ApiClient { )); } + /// 默认 API 地址;正式上线后切回 https://api.gogenex.cn + static const String defaultBaseUrl = 'http://154.84.135.121:48080'; + static ApiClient get instance { - _instance ??= ApiClient._(baseUrl: 'https://api.gogenex.cn'); + _instance ??= ApiClient._(baseUrl: defaultBaseUrl); return _instance!; } diff --git a/frontend/genex-mobile/lib/main.dart b/frontend/genex-mobile/lib/main.dart index 10400b2..c5a50ff 100644 --- a/frontend/genex-mobile/lib/main.dart +++ b/frontend/genex-mobile/lib/main.dart @@ -40,9 +40,9 @@ import 'features/coupons/presentation/pages/wallet_coupons_page.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - // 初始化升级服务 + // 初始化升级服务(测试阶段指向内部服务器) UpdateService().initialize(UpdateConfig.selfHosted( - apiBaseUrl: 'https://api.gogenex.cn', + apiBaseUrl: 'http://154.84.135.121:48080', enabled: true, )); diff --git a/frontend/miniapp/src/config/index.ts b/frontend/miniapp/src/config/index.ts index 3e44bce..19da137 100644 --- a/frontend/miniapp/src/config/index.ts +++ b/frontend/miniapp/src/config/index.ts @@ -4,7 +4,7 @@ const envConfig = { development: { - API_BASE_URL: 'http://localhost:8080', + API_BASE_URL: 'http://154.84.135.121:48080', }, production: { API_BASE_URL: 'https://api.gogenex.cn',