Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Board/BoardFreeWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const BoardFreeWrite = () => {
position: 'relative',
top: '80px',
right: '600px',
zIndex: '1',
}}
id='attachedFile'
ref={fileInput}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Bupbong/Bupbong.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Bupbong = (effect, deps) => {

const amount = parseInt(amountStr.replace(/,/g, ''), 10);

IMP.init([['imp42507411']]);
IMP.init('imp42507411');
const datas = {
pg: 'tosspayment',
pay_method: 'card',
Expand Down
2 changes: 1 addition & 1 deletion src/components/JoinList/JoinList.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const JoinList = ({ setPBtnCnt, currentPage, onPageChange }) => {
};

useEffect(() => {
if (loggedUser.mode == 'user' || loggedUser.mode == 'lawyer') {
if (loggedUser.mode !== 'master') {
alert('페이지 접근 권한이 없습니다.');
navigate('/');
} else {
Expand Down
13 changes: 9 additions & 4 deletions src/components/Login/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,23 @@ const LoginForm = ({ mode, setMode }) => {
});

if (res.status === 200) {
if (loggedUser.mode === 'master') {
console.log(loggedUser.mode);
console.log('master로그인');
const data = await res.json();
// 관리자 처리
if (data.authority === 'master') {
console.log('master 로그인');
const userInfo = { id: data.id, name: 'master', mode: data.authority };
dispatch(setUser(userInfo));
navigate('/joinList/');
return;
}
const data = await res.json();

localStorage.setItem('accessToken', data.accessToken);
// 미승인 변호사 처리
const userInfo = { id: data.id, name: data.name, mode: data.authority };
if (data.authority === 'notApproval') {
alert('미승인 상태의 변호사는 접근 권한이 제한될 수 있습니다.');
}
// 그외 로그인 성공 처리
dispatch(setUser(userInfo));
} else {
const text = await res.text();
Expand Down
6 changes: 6 additions & 0 deletions src/components/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const MainPage = () => {
dispatch(logout());
alert('로그아웃 되었습니다.');
navigate('/');
} else if (res.status === 500) {
console.log('소셜 로그인 로그아웃 처리 오류');
localStorage.clear();
dispatch(logout());
alert('로그아웃 되었습니다.');
navigate('/');
}
} catch (error) {
console.error('로그아웃 에러:', error);
Expand Down
3 changes: 3 additions & 0 deletions src/components/scss/Board.scss
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@
width: calc(100vw / 1.14);
flex-direction: row-reverse;
margin-top: 20px;
position: relative;
right: 120px;
top: 50px;
.board-write-btn {
width: 171px;
height: 43px;
Expand Down
4 changes: 2 additions & 2 deletions src/config/host-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const clientHostName = window.location.hostname;

// let backEndHostName = 'http://localhost:80';
let backEndHostName = "http://54.180.52.142"; // 백엔드 서버 호스트 이름
let backEndHostName = 'http://54.180.52.142'; // 백엔드 서버 호스트 이름

// if (clientHostName === 'localhost') {
// console.log('clientHostName는 : ', clientHostName);
Expand All @@ -19,7 +19,7 @@ let backEndHostName = "http://54.180.52.142"; // 백엔드 서버 호스트 이
// backEndHostName = 'http://15.164.178.169'; // ec2 의 도메인주소가 들어와야 함.
// }

export const API_BASE_URL = backEndHostName + "/api";
export const API_BASE_URL = backEndHostName + '/api';
// export const USER = "/api/user";
// export const LAWYER = "/api/lawyer";
// export const MYPAGE = "/api/mypage";
Expand Down