About -> UserCP

This commit is contained in:
Jörn-Michael Miehe 2019-05-09 14:20:03 +02:00
parent 25630bba41
commit e6bfa62381
4 changed files with 10 additions and 10 deletions

View file

@ -61,7 +61,7 @@ export default {
let cookie_data = JSON.parse(response.data.message) let cookie_data = JSON.parse(response.data.message)
Cookies.set('session', cookie_data.value, cookie_data.properties) Cookies.set('session', cookie_data.value, cookie_data.properties)
this.$refs.main.showSnackbar('Login successful!', 'success') this.$refs.main.showSnackbar('Login successful!', 'success')
this.$router.push('about') this.$router.push('usercp')
} else { } else {
this.$refs.main.showSnackbar(response.data.message, 'error') this.$refs.main.showSnackbar(response.data.message, 'error')
} }

View file

@ -14,13 +14,13 @@ export default new Router({
component: Home component: Home
}, },
{ {
path: '/about', path: '/usercp',
name: 'about', name: 'usercp',
// route level code-splitting // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (usercp.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => component: () =>
import(/* webpackChunkName: "about" */ './views/About.vue') import(/* webpackChunkName: "usercp" */ './views/UserCP.vue')
}, },
{ {
path: '/game', path: '/game',

View file

@ -38,7 +38,7 @@ export default {
}) })
.then(response => { .then(response => {
if (response.data.success) { if (response.data.success) {
this.$router.push({ name: 'about' }) this.$router.push({ name: 'usercp' })
} }
}) })
} }

View file

@ -2,7 +2,7 @@
<v-container> <v-container>
<Header /> <Header />
<p>user session: {{ sessionID }}</p> <p>user logged in: {{ user }}</p>
<v-btn @click.native="logout">Logout</v-btn> <v-btn @click.native="logout">Logout</v-btn>
</v-container> </v-container>
</template> </template>
@ -14,14 +14,14 @@ import axios from '@/plugins/axios'
import Header from '@/components/Header.vue' import Header from '@/components/Header.vue'
export default { export default {
name: 'About', name: 'UserCP',
components: { components: {
Header Header
}, },
data: () => ({ data: () => ({
sessionID: '' user: ''
}), }),
methods: { methods: {
@ -50,7 +50,7 @@ export default {
}) })
.then(response => { .then(response => {
if (response.data.success) { if (response.data.success) {
this.sessionID = response.data.message this.user = response.data.message
} else { } else {
this.goHome() this.goHome()
} }