Skip to content

Commit

Permalink
Merge pull request #220 from suyuan32/dev
Browse files Browse the repository at this point in the history
fix(role authorization): judge menu checked key type to avoid undefin…
  • Loading branch information
suyuan32 committed Jun 8, 2024
2 parents fdb7c13 + 4059d4a commit 142c924
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/views/sys/role/RoleDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import { ApiListResp } from '@/api/sys/model/apiModel';
import { buildDataNode } from '@/utils/tree';
import { BasicTree, TreeActionType } from '@/components/Tree';
import { isArray } from 'remeda';
export default defineComponent({
name: 'RoleDrawer',
Expand Down Expand Up @@ -213,7 +214,9 @@
const roleData = await getFieldsValue();
const result = await createOrUpdateMenuAuthority({
roleId: Number(roleData['id']),
menuIds: getMenuTree().getCheckedKeys()['checked'] as number[],
menuIds: isArray(getMenuTree().getCheckedKeys())
? (getMenuTree().getCheckedKeys() as number[])
: (getMenuTree().getCheckedKeys()['checked'] as number[]),
});
if (result.code === 0) {
childrenDrawer.value = false;
Expand Down

0 comments on commit 142c924

Please sign in to comment.