From 090e4bf74bdf527dd6e9ae017aa6c055414c15bb Mon Sep 17 00:00:00 2001 From: nauxscript Date: Wed, 24 Jan 2024 15:46:08 +0800 Subject: [PATCH 1/5] fix: change signin to login --- apps/api/src/auth/auth.controller.ts | 6 +++--- apps/client/api/auth.ts | 16 ++++++++-------- apps/client/pages/Auth/{SignIn.vue => Login.vue} | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) rename apps/client/pages/Auth/{SignIn.vue => Login.vue} (97%) diff --git a/apps/api/src/auth/auth.controller.ts b/apps/api/src/auth/auth.controller.ts index 29b4b254d..c02e20f61 100644 --- a/apps/api/src/auth/auth.controller.ts +++ b/apps/api/src/auth/auth.controller.ts @@ -13,11 +13,11 @@ import { CreateUserDto } from '../user/model/user.dto'; @Controller('auth') export class AuthController { - constructor(private readonly authService: AuthService) { } + constructor(private readonly authService: AuthService) {} - @Post('signin') + @Post('login') sign(@Body() dto: SignDto) { - return this.authService.signIn(dto); + return this.authService.login(dto); } @Post('signup') diff --git a/apps/client/api/auth.ts b/apps/client/api/auth.ts index 67bacd36e..214dd27f2 100644 --- a/apps/client/api/auth.ts +++ b/apps/client/api/auth.ts @@ -1,21 +1,21 @@ import { type ErrorVo, isError } from "./common"; -interface SignInDto { +interface LoginDto { phone: string; password: string; } -interface SignUpDto extends SignInDto { +interface SignUpDto extends LoginDto { name: string; } -interface SignInVo { +interface LoginVo { token: string; } -export async function signin(dto: SignInDto) { +export async function login(dto: LoginDto) { const message = useMessage(); - const { data } = await useFetchPlus("/auth/signin", { + const { data } = await useFetchPlus("/auth/login", { body: dto, method: "post", }); @@ -23,12 +23,12 @@ export async function signin(dto: SignInDto) { message.error(data.value.message); return; } - return data.value as SignInVo; + return data.value as LoginVo; } export async function signUp(dto: SignUpDto) { const message = useMessage(); - const { data } = await useFetchPlus("/auth/signup", { + const { data } = await useFetchPlus("/auth/signup", { body: dto, method: "post", }); @@ -36,5 +36,5 @@ export async function signUp(dto: SignUpDto) { message.error(data.value.message); return; } - return data.value as SignInVo; + return data.value as LoginVo; } diff --git a/apps/client/pages/Auth/SignIn.vue b/apps/client/pages/Auth/Login.vue similarity index 97% rename from apps/client/pages/Auth/SignIn.vue rename to apps/client/pages/Auth/Login.vue index 518bf590e..e5d6b0fda 100644 --- a/apps/client/pages/Auth/SignIn.vue +++ b/apps/client/pages/Auth/Login.vue @@ -31,7 +31,7 @@ @@ -13,19 +14,18 @@ class="text-fuchsia-400 font-bold">EARTHWORM yet! 🤪 + + + - - - -
@@ -83,3 +83,4 @@ background-position: 0 0, var(--bgPosition) var(--bgPosition); mask-image: linear-gradient(rgb(0 0 0), rgb(0 0 0 / 0.5)); } +