<template>
    <div class="error-page">
        <a-result status="403" title="403" sub-title="抱歉，您没有权限访问此页面">
            <template #extra>
                <a-space>
                    <a-button type="primary" @click="goHome">
                        返回首页
                    </a-button>
                    <a-button @click="$router.back()">返回上一页</a-button>
                </a-space>
            </template>
        </a-result>
    </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { useAuthStore } from '@/stores/auth'

const router = useRouter()
const authStore = useAuthStore()

const goHome = () => {
    const tenantCode = authStore.user?.tenantCode || 'super'
    router.push(`/${tenantCode}/workbench`)
}
</script>

<style scoped lang="scss">
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
</style>
