由于本次代码变更内容为空,无法生成有效的提交信息。请提供具体的代码变更内容以便生成合适的提交信息。
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<router-link to="/dashboard" />
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item key="users">
|
||||
<a-menu-item v-if="hasPermission('user:read')" key="users">
|
||||
<template #icon>
|
||||
<UserOutlined />
|
||||
</template>
|
||||
@@ -36,7 +36,7 @@
|
||||
<router-link to="/users" />
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item key="merchants">
|
||||
<a-menu-item v-if="hasPermission('merchant:read')" key="merchants">
|
||||
<template #icon>
|
||||
<ShopOutlined />
|
||||
</template>
|
||||
@@ -44,7 +44,7 @@
|
||||
<router-link to="/merchants" />
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item key="travel">
|
||||
<a-menu-item v-if="hasPermission('travel:read')" key="travel">
|
||||
<template #icon>
|
||||
<CompassOutlined />
|
||||
</template>
|
||||
@@ -52,7 +52,7 @@
|
||||
<router-link to="/travel" />
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item key="animals">
|
||||
<a-menu-item v-if="hasPermission('animal:read')" key="animals">
|
||||
<template #icon>
|
||||
<HeartOutlined />
|
||||
</template>
|
||||
@@ -60,7 +60,7 @@
|
||||
<router-link to="/animals" />
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item key="orders">
|
||||
<a-menu-item v-if="hasPermission('order:read')" key="orders">
|
||||
<template #icon>
|
||||
<ShoppingCartOutlined />
|
||||
</template>
|
||||
@@ -68,7 +68,7 @@
|
||||
<router-link to="/orders" />
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item key="promotion">
|
||||
<a-menu-item v-if="hasPermission('promotion:read')" key="promotion">
|
||||
<template #icon>
|
||||
<GiftOutlined />
|
||||
</template>
|
||||
@@ -76,7 +76,7 @@
|
||||
<router-link to="/promotion" />
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item key="system">
|
||||
<a-menu-item v-if="hasPermission('system:read')" key="system">
|
||||
<template #icon>
|
||||
<SettingOutlined />
|
||||
</template>
|
||||
@@ -194,6 +194,11 @@ const currentRouteMeta = computed(() => route.meta || {})
|
||||
const userName = computed(() => appStore.state.user?.nickname || '管理员')
|
||||
const userAvatar = computed(() => appStore.state.user?.avatar || 'https://api.dicebear.com/7.x/miniavs/svg?seed=admin')
|
||||
|
||||
// 权限检查方法
|
||||
const hasPermission = (permission: string) => {
|
||||
return appStore.hasPermission(permission)
|
||||
}
|
||||
|
||||
// 监听路由变化
|
||||
router.afterEach((to) => {
|
||||
selectedKeys.value = [to.name as string]
|
||||
|
||||
Reference in New Issue
Block a user