This repository has been archived on 2024-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
node-fftcg/frontend/src/views/Home.vue

54 lines
1 KiB
Vue
Raw Normal View History

2019-02-22 19:23:42 +00:00
<template>
2019-05-27 10:10:50 +00:00
<v-content>
<v-container>
<Header>
2019-05-27 12:34:07 +00:00
<LoginForm :session="session" />
2019-05-27 10:10:50 +00:00
<RegisterForm />
</Header>
2019-05-06 02:05:32 +00:00
2019-05-27 10:10:50 +00:00
<p class="subheading font-weight-regular">
App under development, please don't submit any valuable data!
</p>
</v-container>
</v-content>
2019-02-22 19:23:42 +00:00
</template>
<script>
2019-05-07 20:28:51 +00:00
import * as Cookies from 'js-cookie'
import axios from '@/plugins/axios'
2019-05-08 19:34:50 +00:00
import Header from '@/components/Header.vue'
2019-05-06 02:05:32 +00:00
import LoginForm from '@/components/forms/Login.vue'
2019-05-06 14:18:23 +00:00
import RegisterForm from '@/components/forms/Register.vue'
2019-02-22 19:23:42 +00:00
export default {
2019-05-06 02:05:32 +00:00
name: 'Home',
2019-05-07 20:28:51 +00:00
2019-02-22 19:23:42 +00:00
components: {
2019-05-08 19:34:50 +00:00
Header,
2019-05-06 14:18:23 +00:00
LoginForm,
RegisterForm
2019-05-07 20:28:51 +00:00
},
computed: {
session: () => Cookies.get('session')
},
2019-05-07 20:28:51 +00:00
mounted() {
this.$nextTick(() => {
2019-05-27 15:06:10 +00:00
if (this.session) {
axios
.post('/user/login', {
session: this.session
})
.then(response => {
if (response.data.success) {
this.$router.push({ name: 'deckcp' })
}
})
}
})
2019-02-22 19:23:42 +00:00
}
}
</script>