ff-admin/src/App.vue

58 lines
1.8 KiB
Vue
Raw Normal View History

2024-08-23 14:42:32 +02:00
<template>
2024-08-25 13:37:23 +02:00
<Modal />
<ContextMenu />
2024-08-23 14:42:32 +02: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 />
<Notification />
2025-04-24 16:49:14 +02:00
<Teleport to="head">
2025-04-25 08:18:27 +02:00
<title>{{ clubName }}</title>
2025-04-24 16:49:14 +02:00
<link rel="icon" type="image/ico" :href="config.server_address + '/api/public/favicon.ico'" />
<link rel="icon" type="image/png" href="/icon.png" />
2025-04-24 16:49:14 +02:00
<link rel="manifest" :href="config.server_address + '/api/public/manifest.webmanifest'" />
</Teleport>
2024-08-23 14:42:32 +02:00
</template>
2024-08-22 11:48:04 +02:00
<script setup lang="ts">
2024-08-23 14:42:32 +02:00
import { defineComponent } from "vue";
import { RouterView } from "vue-router";
import Header from "./components/Header.vue";
import Footer from "./components/Footer.vue";
2025-04-24 16:49:14 +02:00
import { mapActions, mapState } from "pinia";
2024-08-23 14:42:32 +02:00
import { useAuthStore } from "./stores/auth";
2024-11-21 15:58:58 +01:00
import { isAuthenticatedPromise } from "./router/authGuard";
2024-08-25 13:37:23 +02:00
import ContextMenu from "./components/ContextMenu.vue";
import Modal from "./components/Modal.vue";
import Notification from "./components/Notification.vue";
2025-04-24 16:49:14 +02:00
import { config } from "./config";
import { useConfigurationStore } from "@/stores/configuration";
import { resetAllPiniaStores } from "@/helpers/piniaReset";
2024-08-22 11:48:04 +02:00
</script>
2024-08-23 14:42:32 +02:00
<script lang="ts">
export default defineComponent({
computed: {
...mapState(useAuthStore, ["authCheck"]),
2025-04-24 16:49:14 +02:00
...mapState(useConfigurationStore, ["clubName"]),
2024-08-23 14:42:32 +02:00
},
mounted() {
resetAllPiniaStores();
2025-04-24 16:49:14 +02:00
this.configure();
2024-08-23 14:42:32 +02:00
if (!this.authCheck && localStorage.getItem("access_token")) {
isAuthenticatedPromise().catch(() => {
localStorage.removeItem("access_token");
2024-08-25 13:37:23 +02:00
localStorage.removeItem("refresh_token");
2024-08-23 14:42:32 +02:00
});
}
},
2025-04-24 16:49:14 +02:00
methods: {
...mapActions(useConfigurationStore, ["configure"]),
},
2024-08-23 14:42:32 +02:00
});
</script>