diff --git a/frontend/src/App.vue b/frontend/src/App.vue index ff7e97505fa6a5d357060fd50f214ad8ed8e71a5..8c4c6352c6c2c854958ca3e4aa9a18ac6a59bcc1 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -6,15 +6,13 @@ <span class="md-title">MajorBook</span> </div> - <div style="flex:1"> - <div align="right"> - <div v-if="!checkLoggedIn"> - <Login /> - <SignUp /> - </div> - <div v-if="checkLoggedIn"> - <Logout /> - </div> + <div style="flex:1; height:20px" align="right"> + <div v-if="isLoggedIn === false"> + <Login /> + <SignUp /> + </div> + <div v-else> + <Logout /> </div> </div> @@ -22,11 +20,7 @@ <md-tabs class="md-primary" style="margin: auto; height: 30px"> <md-tab id="tab-home" md-label="Home" to="/home"></md-tab> <md-tab id="tab-profile" md-label="Profile" to="/profile"></md-tab> - <md-tab - id="tab-list" - md-label="�꾧났�쒖쟻蹂닿린" - to="/BookSearchPage" - ></md-tab> + <md-tab id="tab-list" md-label="�꾧났�쒖쟻蹂닿린" to="/BookSearchPage"></md-tab> </md-tabs> </div> </md-app-toolbar> @@ -63,25 +57,25 @@ export default { }, methods: { checkSession() { - this.$http.get("/api/login/checkSession").then(function(response) { - //console.log(response.data); + this.$http.get("/api/login/checkSession").then(response => { + console.log(response.data); if (response.data === true) { - return true; + return (this.isLoggedIn = true); } else { - return false; + return (this.isLoggedIn = false); } }); } - }, - computed: { - checkLoggedIn() { - console.log(this.checkSession()); - if (this.checkSession() === true) { - return true; - } - return false; - } } + // computed: { + // checkLoggedIn() { + // console.log(this.checkSession()); + // if (this.checkSession() === true) { + // return true; + // } + // return false; + // } + // } }; </script> diff --git a/frontend/src/components/login/Login.vue b/frontend/src/components/login/Login.vue index 4ace51f26052827a18a4aeb1d810a42e4106d70e..9d27c96a941bea1b2f663017007b7e7af519d7c4 100644 --- a/frontend/src/components/login/Login.vue +++ b/frontend/src/components/login/Login.vue @@ -13,10 +13,8 @@ <md-input v-model="user.password" type="password" /> </md-field> - <md-button class="md-primary" v-on:click="login">Login</md-button> - <md-button class="md-primary" v-on:click="active = false" - >Close</md-button - > + <md-button class="md-raised md-primary" v-on:click="login">Login</md-button> + <md-button class="md-primary" v-on:click="active = false">Close</md-button> </md-dialog> </div> </template> @@ -27,6 +25,7 @@ import VueMaterial from "vue-material"; import "vue-material/dist/vue-material.min.css"; import "vue-material/dist/theme/default.css"; Vue.use(VueMaterial); + export default { data: function() { return { @@ -50,6 +49,7 @@ export default { alert("success login"); //this.$router.push("Logout"); this.active = false; + location.reload(); }, error => { // error 瑜� 蹂댁뿬以� diff --git a/frontend/src/components/login/Logout.vue b/frontend/src/components/login/Logout.vue index a76e5d29636c1226790977494f8567d2724450ca..025fa9cb4a38180871272d7d7b2d7108b72f8510 100644 --- a/frontend/src/components/login/Logout.vue +++ b/frontend/src/components/login/Logout.vue @@ -20,7 +20,9 @@ export default { console.log("Logout start"); this.$http.get("/api/login/logout").then(response => { if (response) { + alert("success logout"); //this.$router.push("home"); + location.reload(); } }); }