feat(partner): require WeChat OAuth before store photo upload

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-03 15:44:46 +08:00
parent 81413e4d08
commit cabc9e6ebb
11 changed files with 231 additions and 13 deletions
@@ -114,7 +114,17 @@ export class PartnerAuthController {
}
@Post('login/wechat')
wechatLogin(@Body() dto: LoginWechatDto) {
@UseGuards(OptionalJwtAuthGuard)
wechatLogin(@Req() req: Request, @Body() dto: LoginWechatDto) {
const user = (req as Request & { user?: AuthUser }).user;
if (user?.actorType === 'PARTNER') {
return this.authService.bindPartnerWechat(
user.actorId,
dto.code,
ClientApp.PARTNER_H5,
dto.platform ?? 'h5',
);
}
return this.authService.loginPartnerWechat(dto.code, ClientApp.PARTNER_H5, dto.platform ?? 'h5');
}
}