release v2.0.0 #4
|
@ -8,13 +8,6 @@ export default boot<Store<StateInterface>>(({ router, store }) => {
|
||||||
const session = store.state.session.currentSession;
|
const session = store.state.session.currentSession;
|
||||||
|
|
||||||
if (to.name != 'login') {
|
if (to.name != 'login') {
|
||||||
if (!session || session.expires <= new Date()) {
|
|
||||||
store.dispatch('session/logout').catch(error => {
|
|
||||||
console.warn(error);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
to.matched.every((record: RouteRecord) => {
|
to.matched.every((record: RouteRecord) => {
|
||||||
if (!('meta' in record) || !('permissions' in record.meta))
|
if (!('meta' in record) || !('permissions' in record.meta))
|
||||||
|
@ -30,6 +23,20 @@ export default boot<Store<StateInterface>>(({ router, store }) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
|
if (
|
||||||
|
!to.matched.every((record: RouteRecord) => {
|
||||||
|
if (!('meta' in record) || !('permissions' in record.meta))
|
||||||
|
return true;
|
||||||
|
else return false;
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
if (!session || session.expires <= new Date()) {
|
||||||
|
store.dispatch('session/logout').catch(error => {
|
||||||
|
console.warn(error);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
next();
|
next();
|
||||||
} else {
|
} else {
|
||||||
next({ name: 'login', query: { redirect: to.fullPath } });
|
next({ name: 'login', query: { redirect: to.fullPath } });
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<q-separator />
|
<q-separator/>
|
||||||
<div class="col-12 text-h6 q-pa-sm" v-if="$route.name == 'about'">
|
<div class="col-12 text-h6 q-pa-sm" v-if="$route.name == 'about'">
|
||||||
Geladene Plugins:
|
Geladene Plugins:
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
</q-chip>
|
</q-chip>
|
||||||
</q-chip>
|
</q-chip>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator/>
|
||||||
<div class="col-12 text-h6 q-pa-sm">
|
<div class="col-12 text-h6 q-pa-sm">
|
||||||
Entwickler:
|
Entwickler:
|
||||||
</div>
|
</div>
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from '@vue/composition-api';
|
import {defineComponent} from '@vue/composition-api';
|
||||||
import Developer from 'components/about/Developer.vue';
|
import Developer from 'components/about/Developer.vue';
|
||||||
|
|
||||||
const developers = [
|
const developers = [
|
||||||
|
@ -105,9 +105,9 @@ const developers = [
|
||||||
];
|
];
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
// name: 'PageName'
|
// name: 'PageName'
|
||||||
components: { Developer },
|
components: {Developer},
|
||||||
setup() {
|
setup() {
|
||||||
return { developers };
|
return {developers};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -22,17 +22,18 @@ const routes: RouteConfig[] = [
|
||||||
path: '/main',
|
path: '/main',
|
||||||
redirect: 'dashboard',
|
redirect: 'dashboard',
|
||||||
component: () => import('layouts/MainLayout.vue'),
|
component: () => import('layouts/MainLayout.vue'),
|
||||||
|
meta: { permissions: ['user']},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'dashboard',
|
name: 'dashboard',
|
||||||
path: 'dashboard',
|
path: 'dashboard',
|
||||||
meta: { permission: 'user' },
|
meta: { permissions: ['user'] },
|
||||||
component: () => import('pages/Dashboard.vue')
|
component: () => import('pages/Dashboard.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'about',
|
name: 'about',
|
||||||
path: 'about',
|
path: 'about',
|
||||||
meta: { permission: 'user' },
|
meta: { permissions: ['user'] },
|
||||||
component: () => import('pages/about/About.vue')
|
component: () => import('pages/about/About.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue