Forbidden.vue 1.52 KB
<template>
    <div class="forbidden-container">
        <div class="forbidden-content">
            <div class="forbidden-icon">
                403
            </div>
            <h1 class="forbidden-title">
                无权限访问
            </h1>
            <p class="forbidden-description">
                抱歉,您没有权限访问该页面
            </p>
            <div class="forbidden-actions">
                <el-button type="primary" @click="goHome">
                    返回首页
                </el-button>
                <el-button @click="goBack">
                    返回上一页
                </el-button>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";

const router = useRouter();

const goHome = () => {
	console.log("goHome");
	router.push("/home");
};

const goBack = () => {
	router.back();
};
</script>

<style scoped>
.forbidden-container {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.forbidden-content {
	color: #fff;
	text-align: center;
}

.forbidden-icon {
	margin-bottom: 20px;
	font-size: 120px;
	font-weight: bold;
	text-shadow: 2px 2px 4px rgb(0 0 0 / 30%);
}

.forbidden-title {
	margin-bottom: 16px;
	font-size: 32px;
	font-weight: 600;
}

.forbidden-description {
	margin-bottom: 32px;
	font-size: 16px;
	opacity: 0.9;
}

.forbidden-actions {
	display: flex;
	gap: 16px;
	justify-content: center;
}
</style>