ff-admin/src/App.vue

39 lines
1 KiB
Vue
Raw Normal View History

2024-08-23 12:42:32 +00:00
<template>
2024-08-25 11:37:23 +00:00
<Modal />
<ContextMenu />
2024-08-23 12:42:32 +00:00
<Header @contextmenu.prevent />
<div class="grow overflow-x-hidden overflow-y-auto p-2 md:p-4" @contextmenu.prevent>
<RouterView />
</div>
<Footer @contextmenu.prevent />
</template>
2024-08-22 09:48:04 +00:00
<script setup lang="ts">
2024-08-23 12:42:32 +00:00
import { defineComponent } from "vue";
import { RouterView } from "vue-router";
import Header from "./components/Header.vue";
import Footer from "./components/Footer.vue";
import { mapState } from "pinia";
import { useAuthStore } from "./stores/auth";
import { isAuthenticatedPromise } from "./router/authGuards";
2024-08-25 11:37:23 +00:00
import ContextMenu from "./components/ContextMenu.vue";
import Modal from "./components/Modal.vue";
2024-08-22 09:48:04 +00:00
</script>
2024-08-23 12:42:32 +00:00
<script lang="ts">
export default defineComponent({
computed: {
...mapState(useAuthStore, ["authCheck"]),
},
mounted() {
if (!this.authCheck && localStorage.getItem("access_token")) {
isAuthenticatedPromise().catch(() => {
localStorage.removeItem("access_token");
2024-08-25 11:37:23 +00:00
localStorage.removeItem("refresh_token");
2024-08-23 12:42:32 +00:00
});
}
},
});
</script>