From 287ab6bfa92311256b5d4cf63778e6051ecc1d22 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 20 Dec 2025 18:29:07 -0800 Subject: [PATCH] =?UTF-8?q?fix(identity-service):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=98=BF=E9=87=8C=E4=BA=91=E7=9F=AD=E4=BF=A1=20API=20=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 连接超时从默认值增加到 10 秒 - 读取超时从默认值增加到 10 秒 - 改善网络不稳定环境下的短信发送成功率 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../infrastructure/external/sms/sms.service.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/services/identity-service/src/infrastructure/external/sms/sms.service.ts b/backend/services/identity-service/src/infrastructure/external/sms/sms.service.ts index 499b9f6b..cd0792b1 100644 --- a/backend/services/identity-service/src/infrastructure/external/sms/sms.service.ts +++ b/backend/services/identity-service/src/infrastructure/external/sms/sms.service.ts @@ -90,7 +90,10 @@ export class SmsService implements OnModuleInit { templateParam: JSON.stringify({ code }), }); - const runtime = new $Util.RuntimeOptions({}); + const runtime = new $Util.RuntimeOptions({ + connectTimeout: 10000, // 连接超时 10 秒 + readTimeout: 10000, // 读取超时 10 秒 + }); const response = await this.client.sendSmsWithOptions(sendSmsRequest, runtime); const body = response.body; @@ -162,7 +165,10 @@ export class SmsService implements OnModuleInit { templateParam: JSON.stringify(templateParam), }); - const runtime = new $Util.RuntimeOptions({}); + const runtime = new $Util.RuntimeOptions({ + connectTimeout: 10000, // 连接超时 10 秒 + readTimeout: 10000, // 读取超时 10 秒 + }); const response = await this.client.sendSmsWithOptions(sendSmsRequest, runtime); const body = response.body; @@ -209,7 +215,10 @@ export class SmsService implements OnModuleInit { currentPage: 1, }); - const runtime = new $Util.RuntimeOptions({}); + const runtime = new $Util.RuntimeOptions({ + connectTimeout: 10000, // 连接超时 10 秒 + readTimeout: 10000, // 读取超时 10 秒 + }); const response = await this.client.querySendDetailsWithOptions(querySendDetailsRequest, runtime); return response.body;