1
This commit is contained in:
@@ -19,6 +19,10 @@ export type SendLoginCodeResult = {
|
||||
cooldownSeconds: number;
|
||||
expiresInSeconds: number;
|
||||
providerRequestId: string | null;
|
||||
providerBizId: string | null;
|
||||
providerOutId: string | null;
|
||||
provider: 'aliyun' | 'mock';
|
||||
deliveryStatus: 'pending' | 'delivered';
|
||||
};
|
||||
|
||||
export type SmsVerificationService = {
|
||||
@@ -131,6 +135,10 @@ class AliyunSmsVerificationService implements SmsVerificationService {
|
||||
cooldownSeconds: this.config.intervalSeconds,
|
||||
expiresInSeconds: this.config.validTimeSeconds,
|
||||
providerRequestId: body.requestId ?? body.model?.requestId ?? null,
|
||||
providerBizId: body.model?.bizId ?? null,
|
||||
providerOutId: body.model?.outId ?? null,
|
||||
provider: 'aliyun',
|
||||
deliveryStatus: 'pending',
|
||||
} satisfies SendLoginCodeResult;
|
||||
} catch (error) {
|
||||
if (error instanceof Error && error.name === 'HttpError') {
|
||||
@@ -240,6 +248,10 @@ class MockSmsVerificationService implements SmsVerificationService {
|
||||
cooldownSeconds: this.config.intervalSeconds,
|
||||
expiresInSeconds: this.config.validTimeSeconds,
|
||||
providerRequestId: 'mock-request-id',
|
||||
providerBizId: null,
|
||||
providerOutId: 'mock-out-id',
|
||||
provider: 'mock',
|
||||
deliveryStatus: 'delivered',
|
||||
} satisfies SendLoginCodeResult;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user