flaschengeist-frontend/src/plugins/user/pages/User.vue

52 lines
1.3 KiB
Vue
Raw Normal View History

<template>
<div>
<q-page
padding
class="fit row justify-center content-center items-center"
2020-10-16 07:38:14 +00:00
v-if="checkMain"
>
<q-card
class="col-4"
height=""
>
<q-card-section>
Name: {{ userSession.user.firstname }} {{ userSession.user.lastname }}<br />
E-Mail: {{ userSession.user.mail }}<br />
2020-10-16 07:38:14 +00:00
Roles:
<ul
v-for="role in userSession.user.roles"
v-bind:key="role"
>
2020-10-15 01:36:25 +00:00
<li>{{ role }}</li>
2020-10-16 07:38:14 +00:00
</ul>
<br />
Token expires: {{ userSession.expires }}
</q-card-section>
</q-card>
</q-page>
<router-view />
</div>
</template>
<script lang="ts">
2020-10-15 01:36:25 +00:00
import { defineComponent, computed } from '@vue/composition-api';
2020-10-16 07:38:14 +00:00
import { UserStateInterface } from '../store/user';
import { mainLink } from '../plugin';
2020-10-15 01:36:25 +00:00
export default defineComponent({
// name: 'PageName'
2020-10-15 01:36:25 +00:00
setup(_, { root }) {
2020-10-16 07:38:14 +00:00
const userPermissions = computed(
() => <UserStateInterface>root.$store.getters['user/permissions']
2020-10-16 06:45:40 +00:00
);
const userSession = computed(
() => <UserStateInterface>root.$store.getters['user/session']
2020-10-16 07:38:14 +00:00
);
const checkMain = computed(() => {
return mainLink.name == root.$route.name;
});
return { userPermissions, userSession, checkMain };
}
});
</script>