Browse Source

token 검증 로직 수정(token 없을시 검증 api 요청 제외)

master
김장현 3 weeks ago
parent
commit
70b863cab5
  1. 24
      src/router/hoc/authenticationCheck.tsx

24
src/router/hoc/authenticationCheck.tsx

@ -25,30 +25,12 @@ export default function (SpecificComponent: ReactNode, option: IOption) {
props: IProps
) => JSX.Element;
// useEffect(() => {
// if (user?.cptAuthCode === 'DF0002') {
// const pathname = history.location.pathname;
// if (
// !(
// pathname == '/operation/approvals' ||
// pathname == '/rightMenu' ||
// pathname == 'control/approvals' ||
// pathname == 'control/rightMenu'
// )
// ) {
// // id 나누면 주석 풀 것!!!
// // props.history.replace('/operation/approvals');
// return;
// }
// }
// }, [user]);
useEffect(() => {
// if (props.match.path === '/account/login') {
// setIsRender(true);
// return;
// }
if (getDecodeToken()) {
dispatch(checkToken() as any).then(({ payload }) => {
try {
// 로그인 해야만 접근 가능한 페이지인지 체크하는 옵션
@ -75,9 +57,11 @@ export default function (SpecificComponent: ReactNode, option: IOption) {
}
}
}
setIsRender(true);
} catch (error) {}
});
}
setIsRender(true);
return () => {
setIsRender(false);
};

Loading…
Cancel
Save