微信授权逻辑修改

This commit is contained in:
2026-07-06 20:56:25 +08:00
parent b12ee13232
commit 9d221cfcd2
12 changed files with 475 additions and 28 deletions
@@ -3,6 +3,7 @@ import type { Request } from 'express';
import { AuthService } from './auth.service';
import {
BindPhoneDto,
BindWechatDto,
BindWechatPhoneDto,
BootstrapSessionDto,
LoginSmsDto,
@@ -78,6 +79,17 @@ export class UserAuthController {
);
}
@Post('auth/wechat/bind')
@UseGuards(JwtAuthGuard)
bindWechat(@CurrentUser() user: AuthUser, @Body() dto: BindWechatDto) {
return this.authService.bindUserWechat(
user.actorId,
{ code: dto.code, wxSessionKey: dto.wxSessionKey },
ClientApp.USER_H5,
dto.platform ?? 'h5',
);
}
@Get('auth/me')
@UseGuards(JwtAuthGuard)
me(@CurrentUser() user: AuthUser) {