小程序修改
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
BindPhoneDto,
|
||||
BindWechatDto,
|
||||
BindWechatPhoneDto,
|
||||
MiniWechatProfileDto,
|
||||
BootstrapSessionDto,
|
||||
CheckPartnerPhoneDto,
|
||||
LoginSmsDto,
|
||||
@@ -96,6 +97,23 @@ export class UserAuthController {
|
||||
);
|
||||
}
|
||||
|
||||
@Post('auth/wechat/mini-profile')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
updateMiniWechatProfile(
|
||||
@Req() req: Request,
|
||||
@CurrentUser() user: AuthUser,
|
||||
@Body() dto: MiniWechatProfileDto,
|
||||
) {
|
||||
if (user.actorType !== 'USER') {
|
||||
throw new BadRequestException('仅用户可更新资料');
|
||||
}
|
||||
const clientApp = resolveUserClientApp(req);
|
||||
if (clientApp !== ClientApp.USER_MINI) {
|
||||
throw new BadRequestException('仅小程序端可调用');
|
||||
}
|
||||
return this.authService.updateMiniWechatProfile(user.actorId, dto);
|
||||
}
|
||||
|
||||
@Get('auth/me')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
me(@CurrentUser() user: AuthUser) {
|
||||
|
||||
Reference in New Issue
Block a user