Forbidden.vue
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<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>