49 lines
1.1 KiB
Vue
49 lines
1.1 KiB
Vue
|
|
<template>
|
||
|
|
<div class="error-page-container">
|
||
|
|
<a-result
|
||
|
|
status="403"
|
||
|
|
title="401"
|
||
|
|
sub-title="抱歉,您没有权限访问该页面,请尝试重新登录或联系管理员"
|
||
|
|
>
|
||
|
|
<template #extra>
|
||
|
|
<a-space>
|
||
|
|
<a-button type="primary" @click="goHome">
|
||
|
|
<template #icon><home-outlined /></template>
|
||
|
|
回首页
|
||
|
|
</a-button>
|
||
|
|
</a-space>
|
||
|
|
</template>
|
||
|
|
</a-result>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script setup lang="ts">
|
||
|
|
import { useRouter } from 'vue-router';
|
||
|
|
import { HomeOutlined, ReloadOutlined } from '@ant-design/icons-vue';
|
||
|
|
|
||
|
|
const router = useRouter();
|
||
|
|
|
||
|
|
// 返回首页(由 permission 守卫动态匹配第一个可用路由)
|
||
|
|
const goHome = () => {
|
||
|
|
router.push('/');
|
||
|
|
};
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.error-page-container {
|
||
|
|
height: 100vh;
|
||
|
|
display: flex;
|
||
|
|
justify-content: center;
|
||
|
|
align-items: center;
|
||
|
|
background: #f0f2f5;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* 调整 Result 组件样式,使其更美观 */
|
||
|
|
.error-page-container :deep(.ant-result) {
|
||
|
|
padding: 48px 32px;
|
||
|
|
background: #fff;
|
||
|
|
border-radius: 8px;
|
||
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||
|
|
}
|
||
|
|
</style>
|