<template>
  <div>
    <n-button @click="useAuthStore.logout()">注销</n-button>
  </div>
</template>
<script lang="ts" setup>
import { router, UseAuthStore } from '@/plugin';
import { onMounted } from 'vue';

const useAuthStore = UseAuthStore();

onMounted(() => {
  if (!useAuthStore.isLogin)
    router.push({
      name: 'login',
    });
});
</script>
<style scoped></style>
