fix: 禁止admin修改菜单分配
This commit is contained in:
@@ -32,8 +32,10 @@ import { hasPermissions } from '@/plugins/auth-user';
|
|||||||
import { MENU_PATH_INLINE } from '@/constants/menu-constants';
|
import { MENU_PATH_INLINE } from '@/constants/menu-constants';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
|
import useUserStore from '@/store/modules/user';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { getDict } = useDictStore();
|
const { getDict } = useDictStore();
|
||||||
|
const userStore = useUserStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const routePath = route.path;
|
const routePath = route.path;
|
||||||
@@ -940,7 +942,7 @@ onMounted(() => {
|
|||||||
v-if="
|
v-if="
|
||||||
dict.sysNormalDisable.length > 0 &&
|
dict.sysNormalDisable.length > 0 &&
|
||||||
record.roleId !== '1' &&
|
record.roleId !== '1' &&
|
||||||
record.roleKey !== 'admin' &&
|
!userStore.roles?.includes(record.roleKey) &&
|
||||||
record.roleKey !== 'tenant' &&
|
record.roleKey !== 'tenant' &&
|
||||||
hasPermissions(['system:role:edit'])
|
hasPermissions(['system:role:edit'])
|
||||||
"
|
"
|
||||||
@@ -974,7 +976,7 @@ onMounted(() => {
|
|||||||
v-if="
|
v-if="
|
||||||
record.roleId !== '1' &&
|
record.roleId !== '1' &&
|
||||||
record.roleKey !== 'tenant' &&
|
record.roleKey !== 'tenant' &&
|
||||||
record.roleKey !== 'admin'
|
!userStore.roles?.includes(record.roleKey)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<template #title>{{ t('common.editText') }}</template>
|
<template #title>{{ t('common.editText') }}</template>
|
||||||
@@ -990,7 +992,7 @@ onMounted(() => {
|
|||||||
v-if="
|
v-if="
|
||||||
record.roleId !== '1' &&
|
record.roleId !== '1' &&
|
||||||
record.roleKey !== 'tenant' &&
|
record.roleKey !== 'tenant' &&
|
||||||
record.roleKey !== 'admin'
|
!userStore.roles?.includes(record.roleKey)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<template #title>{{ t('common.deleteText') }}</template>
|
<template #title>{{ t('common.deleteText') }}</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user