pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
599 B
28 lines
599 B
<template>
|
|
<router-view></router-view>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
import { store } from '@/store';
|
|
import { readHasAdminAccess } from '@/store/main/getters';
|
|
|
|
const routeGuardAdmin = async (to, from, next) => {
|
|
if (!readHasAdminAccess(store)) {
|
|
next('/main');
|
|
} else {
|
|
next();
|
|
}
|
|
};
|
|
|
|
@Component
|
|
export default class Admin extends Vue {
|
|
public beforeRouteEnter(to, from, next) {
|
|
routeGuardAdmin(to, from, next);
|
|
}
|
|
|
|
public beforeRouteUpdate(to, from, next) {
|
|
routeGuardAdmin(to, from, next);
|
|
}
|
|
}
|
|
</script>
|
|
|