From f7348fa62684366761481b53c9ee695164a7e3a8 Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Wed, 22 May 2024 16:50:32 +0900 Subject: [PATCH] Feat: add login page --- src/components/AppHeader.vue | 1 - src/components/users/UserLogin.vue | 154 +++++++++++++++++------------ src/router/index.js | 24 ++--- src/views/TheUserView.vue | 14 --- src/views/UserView.vue | 20 ++++ 5 files changed, 120 insertions(+), 93 deletions(-) delete mode 100644 src/views/TheUserView.vue create mode 100644 src/views/UserView.vue diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index ca40be3..c8c5310 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -30,7 +30,6 @@ const logout = () => { diff --git a/src/components/users/UserLogin.vue b/src/components/users/UserLogin.vue index 600704d..1696299 100644 --- a/src/components/users/UserLogin.vue +++ b/src/components/users/UserLogin.vue @@ -1,78 +1,104 @@ - + diff --git a/src/router/index.js b/src/router/index.js index d093ce2..25ad9ae 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -10,21 +10,21 @@ const onlyAuthUser = async (to, from, next) => { const { userInfo, isLogin } = storeToRefs(memberStore); const { isValidToken } = memberStore; - let token = localStorage.getItem("accessToken"); - console.log(userInfo) - console.log(isLogin) + let token = localStorage.getItem('accessToken'); + console.log(userInfo); + console.log(isLogin); // if (userInfo.value != null && token) { - console.log(isLogin.value) - console.log(token) + console.log(isLogin.value); + console.log(token); if (isLogin.value != null && token) { - console.log("이프문들어옴") + console.log('이프문들어옴'); await isValidToken(token); } if (isLogin.value === null) { - console.log("이프문2들어옴") - next({ name: "user-login" }); + console.log('이프문2들어옴'); + next({ name: 'user-login' }); } else { - console.log("else문 들어옴") + console.log('else문 들어옴'); next(); } }; @@ -40,7 +40,7 @@ const router = createRouter({ { path: '/user', name: 'user', - component: () => import('@/views/TheUserView.vue'), + component: () => import('@/views/UserView.vue'), children: [ { path: 'login', @@ -97,10 +97,6 @@ const router = createRouter({ }, ], }, - { - path: '/test', - component: () => import('@/views/TestView.vue'), - }, ], }); diff --git a/src/views/TheUserView.vue b/src/views/TheUserView.vue deleted file mode 100644 index 4681a42..0000000 --- a/src/views/TheUserView.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/src/views/UserView.vue b/src/views/UserView.vue new file mode 100644 index 0000000..7fb0e13 --- /dev/null +++ b/src/views/UserView.vue @@ -0,0 +1,20 @@ + + + + +