Fix access to public role permissions (#11904)

This commit is contained in:
ian
2022-03-02 00:23:48 +08:00
committed by GitHub
parent 8f844ee289
commit 7dc76428c3

View File

@@ -69,7 +69,7 @@ import { unexpectedError } from '@/utils/unexpected-error';
import { translate } from '@/utils/translate-object-values';
type Role = {
id: number;
id: string;
name: string;
description: string;
icon: string;
@@ -176,12 +176,14 @@ export default defineComponent({
}
function navigateToRole({ item }: { item: Role }) {
router.push({
name: 'settings-roles-item',
params: lastAdminRoleId.value
? { primaryKey: item.id, lastAdminRoleId: lastAdminRoleId.value }
: { primaryKey: item.id },
});
if (item.id !== 'public' && lastAdminRoleId.value) {
router.push({
name: 'settings-roles-item',
params: { primaryKey: item.id, lastAdminRoleId: lastAdminRoleId.value },
});
} else {
router.push(`/settings/roles/${item.id}`);
}
}
},
});