login and auth
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import Layout from "@/components/Layout.vue";
|
||||
import { useAuthKey } from "@/services/auth";
|
||||
import { NDialogProvider, NMessageProvider } from "naive-ui";
|
||||
import { computed } from "vue";
|
||||
|
||||
const authKey = useAuthKey();
|
||||
const isLoggedIn = computed(() => !!authKey.value);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-message-provider>
|
||||
<n-dialog-provider>
|
||||
<layout />
|
||||
<layout v-if="isLoggedIn" />
|
||||
<router-view v-else />
|
||||
</n-dialog-provider>
|
||||
</n-message-provider>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user