撒点记录登陆ip等信息

This commit is contained in:
黄珑 2025-09-02 11:57:42 +08:00
parent d23acbee1c
commit 8a1b929692
1 changed files with 4 additions and 0 deletions

View File

@ -12,11 +12,15 @@ export class UserController {
@Inject()
userService: UserService;
@Inject()
ctx;
@ApiOkResponse({
type: LoginRes,
})
@Post('/login')
async login(@Body() body) {
this.ctx.logger.info('ip:', this.ctx.ip, '; path:', this.ctx.path, '; user:', body?.username);
try {
const result = await this.userService.login(body);
return successResponse(result, '登录成功');