From b4d20d45ffe6c333794a40cb4371793cb599a127 Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 26 Jun 2022 22:14:31 +0800 Subject: [PATCH] fix: login success status code --- src/modules/user/user.controller.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/user/user.controller.ts b/src/modules/user/user.controller.ts index 693a751c..3b9a9043 100644 --- a/src/modules/user/user.controller.ts +++ b/src/modules/user/user.controller.ts @@ -1,4 +1,13 @@ -import { Body, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common' +import { + Body, + Delete, + Get, + HttpCode, + Param, + Patch, + Post, + Put, +} from '@nestjs/common' import { ApiOperation } from '@nestjs/swagger' import { ApiController } from '~/common/decorator/api-controller.decorator' @@ -57,6 +66,7 @@ export class UserController { @Post('/login') @HttpCache({ disable: true }) + @HttpCode(200) async login(@Body() dto: LoginDto, @IpLocation() ipLocation: IpRecord) { const user = await this.userService.login(dto.username, dto.password) const footstep = await this.userService.recordFootstep(ipLocation.ip)