diff --git a/src/App.tsx b/src/App.tsx
index ca7ae41..ecafa29 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -6,46 +6,22 @@ import useAuthStore from "store/modules/Auth";
function App() {
- const { isLogin } = useAuthStore((state) => state);
const navigate = useNavigate();
+
+ //로그인 정보를 세션에서 값을 가져와 판단
+ // const { isLogin } = useAuthStore((state) => state);
+ const isLogin = sessionStorage.getItem('GomingIsLoginS') === 'true' ? true : false;
useEffect(() => {
//islogin을 확인한다.
//로그인이 되어있으면 메인화면으로 이동
//로그인이 안되어있으면 로그인화면으로 이동
if (isLogin) {
- navigate('/main') //임시주석
+ navigate('/main')
}
}, []);
return (
- //
diff --git a/src/pages/etc/Intro.tsx b/src/pages/etc/Intro.tsx
index f7d90d1..fa3f464 100644
--- a/src/pages/etc/Intro.tsx
+++ b/src/pages/etc/Intro.tsx
@@ -17,10 +17,10 @@ const Intro = () => {
const {setIsNavigation} = useDefaultSets((state)=>state)
const {isLogin} = useAuthStore()
const navigate = useNavigate()
-
- useEffect(()=>{
+ const SESSION_LOGIN = sessionStorage.getItem('GomingIsLoginS')
+ useEffect(()=>{
setIsNavigation(false)
- isLogin && navigate('/main')
+ SESSION_LOGIN && navigate('/main')
return () => setIsNavigation(true)
},[])
diff --git a/src/pages/main/MainContent.tsx b/src/pages/main/MainContent.tsx
index 8be4424..3eca9c2 100644
--- a/src/pages/main/MainContent.tsx
+++ b/src/pages/main/MainContent.tsx
@@ -32,6 +32,9 @@ const MainContent = () => {
useEffect(() => {
console.log(fourCards, oneCard)
+ console.log(todayCardSelectStep);
+ updateTodayCardSelectStatus(true)
+
setHeaderText('')
setIsNavigation(true)
diff --git a/src/pages/mypage/MyPageCategoryList.tsx b/src/pages/mypage/MyPageCategoryList.tsx
index 4b696b6..2a0f5f7 100644
--- a/src/pages/mypage/MyPageCategoryList.tsx
+++ b/src/pages/mypage/MyPageCategoryList.tsx
@@ -23,12 +23,16 @@ const categoryList = [ //카테고리목록
const MyPageCategoryList = () => {
//헤더설정
const {setHeaderText, setHeaderBgColor,setIsNavigation} = useDefaultSets()
- const {updateLoginStatus, logout} = useAuthStore((state)=>state)
+ const {userInfo, updateLoginStatus, logout} = useAuthStore((state)=>state)
const [logoutCheck, setLogoutCheck] = useState
(false)
+
+ const SESSION_LOGIN = sessionStorage.getItem('GomingIsLoginS')
+
useEffect(()=> {
setHeaderText()
setHeaderBgColor(true)
setIsNavigation(true)
+
return (()=> setHeaderBgColor(false))
},[])
@@ -41,6 +45,7 @@ const MyPageCategoryList = () => {
//로그아웃 프로세스
const handleLogout = () => {
+ sessionStorage.removeItem("GomingIsLoginS") //세션스토리지 삭제
logout() //로그아웃
navigate('/login', {replace: true}) //로그인으로 이동
}
@@ -54,12 +59,24 @@ const MyPageCategoryList = () => {
{/* welcome */}
반가워요!
- 카페인중독자님
+
+
+ {userInfo.usrNm ? userInfo.usrNm : '커피중독자'}
+
+
+ 님
+
+
{/* logout btn */}
-
+ {
+ SESSION_LOGIN
+ ? ()
+ : ()
+ }
+