From b6af132d5236833c7278809135f3c63c026ed1b7 Mon Sep 17 00:00:00 2001 From: limingjiu Date: Thu, 30 May 2024 09:32:51 +0800 Subject: [PATCH] rbac --- src/views/sys/UsersView.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/sys/UsersView.vue b/src/views/sys/UsersView.vue index 3e33ac76..717799b6 100644 --- a/src/views/sys/UsersView.vue +++ b/src/views/sys/UsersView.vue @@ -158,8 +158,11 @@ const clearForm = () => { form.status = 0 } -const getRoleName = (item: string): string => { - return roleList.value.filter(role => role.code === item)[0].name +const getRoleName = (item: string) => { + let list = roleList.value.filter(role => role.code === item) + if (list) { + return list[0].name + } } const handleSizeChange = async (val: number) => {