feat: complete login and user management flow

This commit is contained in:
hectorzhao
2026-07-02 16:28:48 +08:00
parent 9c639d54b9
commit e26d8324c3
22 changed files with 1320 additions and 300 deletions
+20 -5
View File
@@ -1,14 +1,29 @@
import { Body, Controller, Post } from '@nestjs/common';
import { Body, Controller, Get, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AuthService, LoginDto } from './auth.service';
@ApiTags('auth')
@Controller('client/auth')
@Controller()
export class AuthController {
constructor(private readonly auth: AuthService) {}
@Post('login')
login(@Body() body: LoginDto) {
return this.auth.login(body);
@Get('admin/auth/captcha')
adminCaptcha() {
return this.auth.createCaptcha();
}
@Post('admin/auth/login')
adminLogin(@Body() body: LoginDto) {
return this.auth.login(body, 'admin');
}
@Get('client/auth/captcha')
clientCaptcha() {
return this.auth.createCaptcha();
}
@Post('client/auth/login')
clientLogin(@Body() body: LoginDto) {
return this.auth.login(body, 'client');
}
}