From c0845f835f4a77eb65a9bee4127099e026c6950d Mon Sep 17 00:00:00 2001 From: Timo Volkmann Date: Tue, 7 May 2019 12:56:04 +0200 Subject: [PATCH 1/5] bugfixes --- frontend/quasar.conf.js | 4 +- frontend/src/layouts/MyLayout.vue | 43 ++++++--- frontend/src/pages/Login.vue | 20 ++--- frontend/src/pages/Register.vue | 21 ++--- frontend/src/router/index.js | 67 +++++++++++++- frontend/src/router/routes.js | 119 +++++++++++++++++++++---- frontend/src/store/dialog/mutations.js | 3 + 7 files changed, 222 insertions(+), 55 deletions(-) diff --git a/frontend/quasar.conf.js b/frontend/quasar.conf.js index 28e7ec3..dc84e20 100644 --- a/frontend/quasar.conf.js +++ b/frontend/quasar.conf.js @@ -109,8 +109,8 @@ module.exports = function (ctx) { }, env: ctx.dev ? { // Base URL for API-Calls: DEV - //API: JSON.stringify('http://localhost:8080') - API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19geocaching'), + API: JSON.stringify('http://localhost:8080'), + // API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19geocaching'), USER_API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19usermanagement') } : { // Base URL for API-Calls: PRODUCTION (build) diff --git a/frontend/src/layouts/MyLayout.vue b/frontend/src/layouts/MyLayout.vue index 943c3f7..7d7815d 100644 --- a/frontend/src/layouts/MyLayout.vue +++ b/frontend/src/layouts/MyLayout.vue @@ -73,6 +73,7 @@ + + + + + Logout + + + - {{ loginText }} + Login @@ -177,22 +195,10 @@ name: "MyLayout", data() { return { - // dialog: { - // color: this, - // show: true, - // message: "Hallo Fehler! Dies ist ein Beispiel Fehler." - // }, leftDrawerOpen: this.$q.platform.is.desktop, - //menuButtonVisible: !this.$q.platform.is.desktop, - //leftDrawerOpen: true, - //miniState: true }; }, computed: { - loginText() { - let text = this.$store.state.auth.isAuthenticated ? "Logout" : "Login"; - return text; - }, dialogShow: { get() { // console.log("get dialogShow: "+this.$store.state.dialog.dialog.show) @@ -234,6 +240,17 @@ console.log("dialogClose(): ") this.$store.commit('dialog/RESET_MESSAGE_DIALOG'); }, + evalAuthentication: function () { + this.$store.commit('auth/SET_AUTHENTICATED'); + this.$store.commit('auth/SET_USER'); + }, + logout: function () { + console.log("logout()"); + console.log(JSON.parse(localStorage.getItem('userToken'))); + localStorage.removeItem('userToken'); + this.evalAuthentication(); + }, + } }; diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 56efa31..2159d3c 100644 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -46,6 +46,16 @@ unelevated @click="logout" /> +
+ +
@@ -140,16 +150,6 @@ logout: function () { console.log("logout()"); console.log(JSON.parse(localStorage.getItem('userToken'))); - // this.$axios.get('/api/logout', { - // params: { - // token: JSON.parse(localStorage.getItem('userToken')) - // } - // }) - // .then((response) => { - // console.log("GET/POST /api/logout/ - response: " + response.data); - // }) - // .catch((error) => { - // }); localStorage.removeItem('userToken'); this.evalAuthentication(); }, diff --git a/frontend/src/pages/Register.vue b/frontend/src/pages/Register.vue index a1d5b2c..33b487f 100644 --- a/frontend/src/pages/Register.vue +++ b/frontend/src/pages/Register.vue @@ -1,43 +1,43 @@ @@ -65,23 +61,21 @@ + + diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 814f108..ec2a41d 100644 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -30,6 +30,7 @@ color="primary" class="full-width" @click="login" + @keyup.enter="login" unelevated >