diff --git a/src/views/sys/UsersView.vue b/src/views/sys/UsersView.vue index 717799b6..26c0e03a 100644 --- a/src/views/sys/UsersView.vue +++ b/src/views/sys/UsersView.vue @@ -159,10 +159,7 @@ const clearForm = () => { } const getRoleName = (item: string) => { - let list = roleList.value.filter(role => role.code === item) - if (list) { - return list[0].name - } + return roleList.value.filter(role => role.code === item)[0]?.name } const handleSizeChange = async (val: number) => { @@ -387,4 +384,4 @@ const getRegisterLink = async (username: string) => { .phone { width: 400px } - \ No newline at end of file +