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";
|
2024-11-21 14:58:58 +00:00
|
|
|
import { isAuthenticatedPromise } from "./router/authGuard";
|
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>
|