<template>
  <div class="no-permission-container">
    <a-result status="403" title="暂无权限">
      <template #subtitle>
        您的账号已创建成功，但暂未分配任何权限。
        <br />
        请联系管理员为您分配角色或权限。
      </template>
      <template #extra>
        <a-button type="primary" @click="handleLogout">返回登录</a-button>
      </template>
    </a-result>
  </div>
</template>

<script setup lang="ts">
import { useUserStore } from '../../stores/user';
import { useRouter } from 'vue-router';

const userStore = useUserStore();
const router = useRouter();

const handleLogout = () => {
  userStore.logout();
  router.push('/login');
};
</script>

<style scoped>
.no-permission-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: var(--color-bg-1);
}
</style>
