fix(identity-service): 增加阿里云短信 API 连接超时时间

- 连接超时从默认值增加到 10 秒
- 读取超时从默认值增加到 10 秒
- 改善网络不稳定环境下的短信发送成功率

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-20 18:29:07 -08:00
parent 3f904ab6f7
commit 287ab6bfa9
1 changed files with 12 additions and 3 deletions

View File

@ -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;