修复bug

This commit is contained in:
2026-07-31 15:34:35 +08:00
parent d0f94d95d7
commit b53fe81999
41 changed files with 362 additions and 3106 deletions
+6 -15
View File
@@ -8,30 +8,21 @@ import { useAccessPreviewStore } from '@/stores/accessPreview'
const route = useRoute()
const router = useRouter()
const access = useAccessPreviewStore()
const sourcePath = computed(() => sanitizeInternalPath(route.query.from))
const previewRoleLabel = computed(() => access.currentRole
? `权限预览:${access.currentRole.name}`
: '当前无可用角色')
async function returnToAccessiblePage() {
if (!access.firstAccessiblePath) return
await router.replace(access.firstAccessiblePath)
if (access.firstAccessiblePath) await router.replace(access.firstAccessiblePath)
}
</script>
<template>
<section class="forbidden-page" aria-labelledby="forbidden-title">
<div class="forbidden-icon" aria-hidden="true">
<ShieldX :size="32" />
</div>
<div class="forbidden-icon" aria-hidden="true"><ShieldX :size="32" /></div>
<p class="section-kicker">403 · 权限不足</p>
<h2 id="forbidden-title">当前预览角色无法访问此页面</h2>
<p>{{ previewRoleLabel }}</p>
<h2 id="forbidden-title">当前登录账号无法访问此页面</h2>
<p>请联系平台管理员核对账号角色和权限配置。</p>
<p class="forbidden-source">来源页面:{{ sourcePath }}</p>
<el-button v-if="access.firstAccessiblePath" type="primary" @click="returnToAccessiblePage">
返回可访问页面
</el-button>
<p v-else>请使用顶栏切换角色,选择具有可访问菜单的角色。</p>
<el-button v-if="access.firstAccessiblePath" type="primary" @click="returnToAccessiblePage">返回可访问页面</el-button>
<p v-else>当前账号暂无可访问的业务菜单。</p>
</section>
</template>