diff --git a/web/src/views/Home.vue b/web/src/views/Home.vue index 662fce9..22740f3 100644 --- a/web/src/views/Home.vue +++ b/web/src/views/Home.vue @@ -48,16 +48,5 @@ import ShapeDividerTop from '@/components/ShapeDividerTop.vue'; }) export default class Home extends Vue { - mounted() { - this.getCurrentUser(); - } - - private getCurrentUser() { - this.$store.dispatch('getCurrentUser') - .then(() => this.$router.push('/dashboard')) - .catch((err: any) => { - this.$router.push('/') - }) - } } diff --git a/web/src/views/Login.vue b/web/src/views/Login.vue index 2e23659..a884a5b 100644 --- a/web/src/views/Login.vue +++ b/web/src/views/Login.vue @@ -55,6 +55,18 @@ export default class Login extends Vue { private username = ''; private password = ''; + mounted() { + this.getCurrentUser(); + } + + private getCurrentUser() { + this.$store.dispatch('getCurrentUser') + .then(() => this.$router.push('/dashboard')) + .catch((err: any) => { + this.$router.push('/') + }) + } + private login() { let user = {username: this.username, password: this.password}