diff --git a/customer-vue/src/router/router.js b/customer-vue/src/router/router.js
index a3afd88..4b85163 100644
--- a/customer-vue/src/router/router.js
+++ b/customer-vue/src/router/router.js
@@ -23,7 +23,7 @@ const authCheck = async function (to, from, next) {
await auth.requestCheckAccessToken();
}
} catch (error) {
- await router.replace("/login");
+ await router.push("/login");
}
next();
};
@@ -60,11 +60,6 @@ const routes = [
name: 'notification',
component: () => import('../views/NotificationView')
},
- {
- path: '/login',
- name: 'login',
- component: () => import('../views/LoginPage')
- },
{
path: "/item/:itemId",
name: 'itemDetail',
@@ -77,6 +72,11 @@ const routes = [
},
]
},
+ {
+ path: '/login',
+ component: () => import('../views/LoginPage'),
+ },
+
{
path: '/store',
redirect: 'store',
diff --git a/customer-vue/src/views/LoginPage.vue b/customer-vue/src/views/LoginPage.vue
index 38add22..9f46eb6 100644
--- a/customer-vue/src/views/LoginPage.vue
+++ b/customer-vue/src/views/LoginPage.vue
@@ -1,77 +1,84 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Login
-
-
- 소셜 아이디로 로그인해보세요!
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+ Login
+
+ 소셜 아이디로 로그인해보세요!
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
-
-
@@ -79,29 +86,31 @@
import logo from '@/assets/justLogo.png'
import logo_naver from '@/assets/logo_naver.svg'
import logo_google from '@/assets/logo_google.png'
+import jwt from "@/common/jwt";
+import router from "@/router/router";
export default {
name: "LoginPage",
- data (){
+ data() {
return {
- logo : logo,
+ logo: logo,
logo_naver: logo_naver,
- logo_google : logo_google,
+ logo_google: logo_google,
auth_popup: null,
}
},
watch: {
- auth_popup : function () {
- this.auth_popup.addEventListener('beforeunload', function() {
- window.location.href=process.env.VUE_APP_BASEURL;
+ auth_popup: function () {
+ this.auth_popup.addEventListener('beforeunload', function () {
+ window.location.href = process.env.VUE_APP_BASEURL;
});
}
},
methods: {
- login_auth: async function(target) {
- const _url = process.env.VUE_APP_CUSTOMER_SERVICE_BASEURL+'/user-service/oauth2/authorization/'+target
+ login_auth: async function (target) {
+ const _url = process.env.VUE_APP_CUSTOMER_SERVICE_BASEURL + '/user-service/oauth2/authorization/' + target
this.auth_popup = window.open(
_url,
"",
@@ -110,9 +119,22 @@ export default {
},
},
+ async mounted() {
+
+ if (!jwt.isExpired())
+ await router.push("/");
+
+ }
}
\ No newline at end of file