From bf26864f61cbda31c3f4a0ebc0a5d2c0e67ae235 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 18 Dec 2024 11:04:22 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=9A=A8fix:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EB=A1=9C=EC=A7=81=20=EB=B0=98=EB=B3=B5=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EB=90=98=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layout.js | 12 ++++++------ src/components/header/Header.jsx | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/layout.js b/src/app/layout.js index 3383aa10..2aa1a30a 100644 --- a/src/app/layout.js +++ b/src/app/layout.js @@ -51,13 +51,13 @@ export default async function RootLayout({ children }) { } } - if (!headerPathname.includes('/login') && !session.isLoggedIn) { - redirect('/login') - } + // if (!headerPathname.includes('/login') && !session.isLoggedIn) { + // redirect('/login') + // } - if (headerPathname === '/login' && session.isLoggedIn) { - redirect('/') - } + // if (headerPathname === '/login' && session.isLoggedIn) { + // redirect('/') + // } return ( diff --git a/src/components/header/Header.jsx b/src/components/header/Header.jsx index b8cfafd2..2e2e98cd 100644 --- a/src/components/header/Header.jsx +++ b/src/components/header/Header.jsx @@ -85,9 +85,9 @@ export default function Header(props) { }) } - useEffect(() => { - getAutoLoginParam() - }, [userSession]) + // useEffect(() => { + // getAutoLoginParam() + // }, [userSession]) const menus = [ { id: 0, name: 'header.menus.home', url: '/', children: [] }, From c1fb6a08cafaf0d81b5e06c6f46f25b371bf9d16 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 18 Dec 2024 11:20:19 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=9A=A8fix:=20=EB=8F=84=EB=A9=B4=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1=20=EB=B2=84=ED=8A=BC=20=EC=95=88=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/auth/Login.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/auth/Login.jsx b/src/components/auth/Login.jsx index af50a515..d53bd12d 100644 --- a/src/components/auth/Login.jsx +++ b/src/components/auth/Login.jsx @@ -87,6 +87,7 @@ export default function Login() { } await promisePost({ url: '/api/login/v1.0/login', data: param }) .then((res) => { + console.log('🚀 ~ .then ~ res:', res) if (res) { if (res.data.result.resultCode === 'S') { setSession(res.data.data) @@ -97,7 +98,7 @@ export default function Login() { } else { Cookies.remove('chkLoginId') } - router.push('/') + // router.push('/') } else { alert(res.data.result.resultMsg) } @@ -106,6 +107,8 @@ export default function Login() { .catch((error) => { alert(error.response.data.message) }) + + router.push('/') } // 비밀번호 초기화 관련 From 4977abcf35993fb3764000696b618a8b2ac522ab Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 18 Dec 2024 13:18:57 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=9A=A8fix:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EC=B2=98=EB=A6=AC=20=EC=9B=90=EB=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layout.js | 12 ++++++------ src/components/auth/Login.jsx | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/app/layout.js b/src/app/layout.js index 2aa1a30a..3383aa10 100644 --- a/src/app/layout.js +++ b/src/app/layout.js @@ -51,13 +51,13 @@ export default async function RootLayout({ children }) { } } - // if (!headerPathname.includes('/login') && !session.isLoggedIn) { - // redirect('/login') - // } + if (!headerPathname.includes('/login') && !session.isLoggedIn) { + redirect('/login') + } - // if (headerPathname === '/login' && session.isLoggedIn) { - // redirect('/') - // } + if (headerPathname === '/login' && session.isLoggedIn) { + redirect('/') + } return ( diff --git a/src/components/auth/Login.jsx b/src/components/auth/Login.jsx index d53bd12d..98f7a5b6 100644 --- a/src/components/auth/Login.jsx +++ b/src/components/auth/Login.jsx @@ -98,7 +98,7 @@ export default function Login() { } else { Cookies.remove('chkLoginId') } - // router.push('/') + router.push('/') } else { alert(res.data.result.resultMsg) } @@ -107,8 +107,6 @@ export default function Login() { .catch((error) => { alert(error.response.data.message) }) - - router.push('/') } // 비밀번호 초기화 관련