短信验证绑定日志内容

This commit is contained in:
2026-07-06 13:26:31 +08:00
parent 1c978b8adc
commit 67af6d7d53
8 changed files with 226 additions and 42 deletions
@@ -31,8 +31,14 @@ export class UserAuthController {
}
@Post('auth/sms/send')
sendSms(@Body() dto: SendSmsDto) {
return this.authService.sendSms(dto.phone, dto.scene);
@UseGuards(OptionalJwtAuthGuard)
sendSms(@Req() req: Request, @Body() dto: SendSmsDto) {
const guest = (req as Request & { user?: AuthUser }).user;
const guestId = guest?.actorType === 'USER' ? guest.actorId : undefined;
return this.authService.sendSms(dto.phone, dto.scene, {
guestUserId: guestId,
clientApp: ClientApp.USER_H5,
});
}
@Post('auth/login/sms')
@@ -85,7 +91,7 @@ export class ShopAuthController {
@Post('sms/send')
sendSms(@Body() dto: SendSmsDto) {
return this.authService.sendSms(dto.phone, dto.scene);
return this.authService.sendSms(dto.phone, dto.scene, { clientApp: ClientApp.SHOP_H5 });
}
@Post('login/sms')
@@ -105,7 +111,7 @@ export class PartnerAuthController {
@Post('sms/send')
sendSms(@Body() dto: SendSmsDto) {
return this.authService.sendSms(dto.phone, dto.scene);
return this.authService.sendSms(dto.phone, dto.scene, { clientApp: ClientApp.PARTNER_H5 });
}
@Post('login/sms')