chore: update access demo
parent
7801a90dcb
commit
ba780a7d3f
|
@ -118,6 +118,17 @@ export class MenuController {
|
|||
title: 'page.demos.access.buttonControl',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'AccessMenuVisible403',
|
||||
path: 'menu-visible-403',
|
||||
component: '/demos/access/menu-visible-403',
|
||||
meta: {
|
||||
authority: ['no-body'],
|
||||
icon: 'mdi:button-cursor',
|
||||
menuVisibleWithForbidden: true,
|
||||
title: 'page.demos.access.menuVisible403',
|
||||
},
|
||||
},
|
||||
roleWithMenus[role],
|
||||
],
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { Fallback } from '@vben/universal-ui';
|
||||
|
||||
defineOptions({ name: 'AccessFrontendAccessTest2' });
|
||||
defineOptions({ name: 'AccessAdminVisible' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -9,7 +9,7 @@ import { Button } from 'ant-design-vue';
|
|||
|
||||
import { useAccessStore, useAppStore } from '#/store';
|
||||
|
||||
defineOptions({ name: 'AccessBackend' });
|
||||
defineOptions({ name: 'AccessButtonControl' });
|
||||
|
||||
const accounts: Record<string, LoginAndRegisterParams> = {
|
||||
admin: {
|
||||
|
@ -41,7 +41,7 @@ async function changeAccount(role: string) {
|
|||
}
|
||||
|
||||
const account = accounts[role];
|
||||
await appStore.resetAppState();
|
||||
appStore.resetAppState();
|
||||
await accessStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
|
@ -51,11 +51,12 @@ async function changeAccount(role: string) {
|
|||
<template>
|
||||
<div class="p-5">
|
||||
<div class="card-box p-5">
|
||||
<h1 class="text-xl font-semibold">后端页面访问权限演示</h1>
|
||||
<h1 class="text-xl font-semibold">
|
||||
{{ accessMode === 'frontend' ? '前端' : '后端' }}页面访问权限演示
|
||||
</h1>
|
||||
<div class="text-foreground/80 mt-2">切换不同的账号,观察按钮变化。</div>
|
||||
</div>
|
||||
|
||||
<template v-if="accessMode === 'backend'">
|
||||
<div class="card-box mt-5 p-5 font-semibold">
|
||||
<div class="mb-3">
|
||||
<span class="text-lg">当前账号:</span>
|
||||
|
@ -113,6 +114,5 @@ async function changeAccount(role: string) {
|
|||
Super & Admin 账号可见 ["AC_100100","AC_1000001"]
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { Fallback } from '@vben/universal-ui';
|
||||
|
||||
defineOptions({ name: 'AccessFrontendAccessTest2' });
|
||||
defineOptions({ name: 'AccessMenuVisible403' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { Fallback } from '@vben/universal-ui';
|
||||
|
||||
defineOptions({ name: 'AccessFrontendAccessTest1' });
|
||||
defineOptions({ name: 'AccessSuperVisible' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { Fallback } from '@vben/universal-ui';
|
||||
|
||||
defineOptions({ name: 'AccessFrontendAccessTest1' });
|
||||
defineOptions({ name: 'AccessUserVisible' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Reference in New Issue