From 8c8f5c611bacd52c2b79871913a3749c321ecd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=84=9C=EC=A0=9C=EA=B2=BD?= Date: Thu, 26 Feb 2026 20:03:18 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EB=82=B4=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20api=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/auth/auth.ts | 21 ++++++------ src/components/Sidebar/Sidebar.tsx | 2 +- src/components/auth/common/InputActions.tsx | 4 +-- .../auth/flows/signup/PasswordSetupStep.tsx | 13 ++----- .../auth/flows/signup/ProfileSetupStep.tsx | 8 +++-- src/components/common/input/Input.tsx | 18 ++++++---- src/hooks/auth/useTokenRefresh.ts | 11 ++++-- src/layout/main/MainLayout.tsx | 7 +++- src/pages/auth/Signup.tsx | 14 ++++++-- src/routes/Router.tsx | 13 ++++--- src/store/useAuthStore.ts | 19 +++++------ src/types/auth/auth.ts | 34 ++++++++----------- 12 files changed, 87 insertions(+), 77 deletions(-) diff --git a/src/api/auth/auth.ts b/src/api/auth/auth.ts index 982bd35..ec7e7ca 100644 --- a/src/api/auth/auth.ts +++ b/src/api/auth/auth.ts @@ -4,6 +4,7 @@ import type { IEmailVerifyRequest, ILoginRequest, ILoginResponse, + IMyPageInfoResponse, IPasswordResetRequest, ISignUpRequest, ISignUpResponse, @@ -15,9 +16,8 @@ import type { } from "@/types/auth/auth"; import type { ICommonResponse } from "@/types/common/common"; -import { axiosInstance } from "@/lib/axiosInstance"; +import { authInstance, axiosInstance } from "@/lib/axiosInstance"; -// 이메일 인증 코드 전송 export const sendEmail = async ({ email, }: IEmailSendRequest): Promise> => { @@ -25,7 +25,6 @@ export const sendEmail = async ({ return data; }; -// 이메일 인증 코드 검증 export const verifyEmail = async ({ email, authCode, @@ -37,7 +36,6 @@ export const verifyEmail = async ({ return data; }; -// 단순 회원가입 export const signUp = async ({ email, password, @@ -53,7 +51,6 @@ export const signUp = async ({ return data; }; -// 토큰 재발급 export const reissueToken = async (): Promise< ICommonResponse > => { @@ -61,19 +58,17 @@ export const reissueToken = async (): Promise< return data; }; -// 로그인 export const login = async ({ email, password, }: ILoginRequest): Promise> => { - const { data } = await axiosInstance.post("/api/auth/login", { + const { data } = await authInstance.post("/api/auth/login", { email, password, }); return data; }; -// SMS 인증 코드 전송 export const sendSMS = async ({ phoneNumber, }: ISmsSendRequest): Promise> => { @@ -83,7 +78,6 @@ export const sendSMS = async ({ return data; }; -// SMS 인증 코드 검증 export const verifySMS = async ({ phoneNumber, verificationCode, @@ -95,7 +89,6 @@ export const verifySMS = async ({ return data; }; -// 비밀번호 재설정 요청 export const requestPasswordReset = async ({ email, }: IEmailSendRequest): Promise> => { @@ -108,7 +101,6 @@ export const requestPasswordReset = async ({ return data; }; -// 비밀번호 재설정 export const resetPassword = async ({ email, password, @@ -122,3 +114,10 @@ export const resetPassword = async ({ ); return data; }; + +export const getMyInfo = async (): Promise< + ICommonResponse +> => { + const { data } = await axiosInstance.get("/api/users/my"); + return data; +}; diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index f43788a..bfe7b92 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -47,7 +47,7 @@ export default function Sidebar() { isCollapsed ? "w-25" : "w-64", ].join(" ")} > -
+
- {timer && ( - {timer} - )} + {timer && {timer}} {button && (