添加 vue-router 依赖并配置路由,重构登录组件,完善 HTTP 请求拦截器以支持 token 刷新机制
This commit is contained in:
37
src/components/PermissionDenied.vue
Normal file
37
src/components/PermissionDenied.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div class="permission-denied">
|
||||
<el-result
|
||||
icon="warning"
|
||||
title="权限不足"
|
||||
sub-title="您没有访问此页面的权限,请联系管理员"
|
||||
>
|
||||
<template #extra>
|
||||
<el-button type="primary" @click="goBack">返回上一页</el-button>
|
||||
<el-button @click="goHome">返回首页</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
function goBack() {
|
||||
router.go(-1)
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
router.push({ name: 'Dashboard' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.permission-denied {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 400px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user