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;