Skip to content

Commit 2906bb3

Browse files
authored
Merge pull request #270 from Computer-Research-Association/feat/#235
Feat/#235
2 parents f6dda5a + 7425187 commit 2906bb3

File tree

8 files changed

+605
-152
lines changed

8 files changed

+605
-152
lines changed

src/api/account.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import { client } from './client';
22

3+
interface FindUsernameParams {
4+
studentId: string;
5+
name: string;
6+
email: string;
7+
}
8+
interface ChangePasswordParams {
9+
code: string;
10+
password: string;
11+
}
312
// email 인증 요청
413
export const emailRequest = async (email: string): Promise<number> => {
514
const response = await client.post<void>(
@@ -15,3 +24,45 @@ export const emailCode = async (emailCode: string): Promise<number> => {
1524
);
1625
return response.status;
1726
};
27+
<<<<<<< HEAD
28+
29+
// PW 재설정
30+
export const changePassword = async ({
31+
code,
32+
password,
33+
}: ChangePasswordParams): Promise<number> => {
34+
const response = await client.put<void>('/user/password-change', {
35+
code,
36+
password,
37+
});
38+
return response.status;
39+
};
40+
41+
// PW 재설정 인증 요청
42+
export const pwEmailRequest = async (username: String): Promise<number> => {
43+
const response = await client.post<void>(
44+
`/account/password-change?username=${username}`,
45+
);
46+
return response.status;
47+
};
48+
49+
// ID 찾기 요청
50+
export const findId = async (params: FindUsernameParams): Promise<string> => {
51+
try {
52+
const response = await client({
53+
method: 'get',
54+
url: '/account/find/username',
55+
params: {
56+
name: params.name,
57+
email: params.email,
58+
studentId: params.studentId,
59+
},
60+
});
61+
return response.data;
62+
} catch (error) {
63+
console.error('Find ID API Error:', error);
64+
throw error;
65+
}
66+
};
67+
=======
68+
>>>>>>> f6dda5ae4326dd6085f6b5a9f1742fd6af896a45

src/components/User/Info/UserInfo.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ function UserInfo() {
2222
<div className={styles.container}>
2323
<div className={styles.title}>마이페이지</div>
2424
<div className={styles.profile}>
25-
<p>프로필 사진 </p>
2625
<div>
2726
<img src={imgUrl} className={styles.preview} />
2827
</div>
2928
</div>
30-
<div className={styles.info}>
31-
<p>이름 </p>
29+
<div className={styles.name}>
30+
{/* <p>이름 </p> */}
3231
{name}
3332
</div>
3433
<div className={styles.info}>

src/components/User/UserPage.module.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@
7373
margin-bottom: 3rem;
7474
}
7575

76+
.name {
77+
display: flex;
78+
justify-content: center;
79+
align-items: center;
80+
font-size: 40px;
81+
font-family: 'Pretendard Bold';
82+
margin-top: 1.5rem;
83+
}
84+
7685
.info {
7786
margin-top: 2rem;
7887
font-family: 'Pretendard SemiBold';
@@ -142,11 +151,17 @@
142151
margin-bottom: 3rem;
143152
}
144153

154+
.profile {
155+
display: flex;
156+
justify-content: center;
157+
align-items: center;
158+
}
159+
145160
.preview {
146161
width: 350px;
147162
height: 350px;
148-
border-radius: 50%;
149-
border: 2px solid var(--color-bright-text);
163+
border-radius: 40%;
164+
border: 1px solid var(--color-bright-text);
150165
object-fit: cover;
151166
}
152167

src/pages/Login/ID/IDSearchCompletePage.tsx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
import { useNavigate } from 'react-router-dom';
1+
import { useNavigate, useLocation } from 'react-router-dom';
22
import BlueCheck from '~/assets/images/Blue-Check.png';
33
import styled from 'styled-components';
44

55
const Container = styled.div`
66
display: flex;
77
flex-direction: column;
8-
justify-content: center;
98
align-items: center;
10-
margin-top: 20rem;
9+
justify-content: center;
10+
width: 100%;
11+
max-width: 1600px;
12+
margin-bottom: 4rem;
13+
padding-top: 5rem;
14+
padding-bottom: 12rem;
15+
@media (max-width: 768px) {
16+
width: 80%;
17+
}
1118
`;
1219

1320
const Img = styled.img`
@@ -33,16 +40,15 @@ const Content = styled.div`
3340

3441
const Context = styled.div`
3542
display: flex;
36-
justify-content: space-between;
43+
justify-content: center;
3744
margin: 2rem 0;
38-
`;
39-
40-
const Black = styled.p`
41-
color: var(--color-dark-text);
45+
width: 100%;
4246
`;
4347

4448
const SkyBlue = styled.p`
4549
color: var(--color-primary);
50+
text-align: center;
51+
width: 100%;
4652
`;
4753

4854
const Buttons = styled.div`
@@ -76,18 +82,21 @@ const LoginBtn = styled.button`
7682

7783
function IDSearchCompletePage() {
7884
const navigate = useNavigate();
85+
const location = useLocation();
86+
87+
// URL에서 id 값을 가져오기
88+
const queryParams = new URLSearchParams(location.search);
89+
const userId = queryParams.get('id') || '알 수 없음'; // id가 없으면 기본값 설정
90+
7991
return (
8092
<Container>
8193
<Img src={BlueCheck} />
8294
<Title>아이디 찾기 완료</Title>
8395
<Content>
8496
<Context>
85-
<Black>가입일</Black>
86-
<Black>2025. 01. 15</Black>
87-
</Context>
88-
<Context>
89-
<SkyBlue>아이디</SkyBlue>
90-
<SkyBlue>dnwnchlrkd206</SkyBlue>
97+
<SkyBlue>
98+
회원님의 아이디는 &nbsp;&nbsp; {userId} &nbsp;&nbsp; 입니다.
99+
</SkyBlue>
91100
</Context>
92101
</Content>
93102
<Buttons>

0 commit comments

Comments
 (0)