diff --git a/src/pages/UserManage.vue b/src/pages/UserManage.vue index 0df199a..d71ad6f 100644 --- a/src/pages/UserManage.vue +++ b/src/pages/UserManage.vue @@ -239,10 +239,15 @@ function edieUserData(row: User) { userInfo.name = row.name; userInfo.mobile = row.mobile; userInfo.registerTime = row.registerTime; - userInfo.roleList = row.roleList; - userInfo.Rids = row.roleList.map((item) => { - return item.roleId; - }); + if (row?.roleList) { + userInfo.roleList = row.roleList; + userInfo.Rids = row.roleList.map((item) => { + return item.roleId; + }); + } else { + userInfo.roleList = []; + userInfo.Rids = []; + } editFormShow.value = true; }