From a9c395cc18e98246dfe9270f1383827a8de3fea9 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 25 May 2021 16:05:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E6=88=B7=E7=BB=84=E5=92=8C?= =?UTF-8?q?=E6=9D=83=E9=99=90):=20=E7=94=A8=E6=88=B7=E7=BB=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/service/GroupService.java | 6 ++++++ .../settings/system/group/EditUserGroup.vue | 10 ++++++---- .../components/settings/system/group/UserGroup.vue | 12 ++++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/GroupService.java b/backend/src/main/java/io/metersphere/service/GroupService.java index 076809c7c1..a564cfc3cf 100644 --- a/backend/src/main/java/io/metersphere/service/GroupService.java +++ b/backend/src/main/java/io/metersphere/service/GroupService.java @@ -107,6 +107,9 @@ public class GroupService { } public void editGroup(EditGroupRequest request) { + if (StringUtils.equals(request.getId(), "admin")) { + MSException.throwException("系统管理员无法编辑!"); + } checkGroupExist(request); Group group = new Group(); request.setScopeId(null); @@ -116,6 +119,9 @@ public class GroupService { } public void deleteGroup(String id) { + if (StringUtils.equals(id, "admin")) { + MSException.throwException("系统管理员无法删除!"); + } groupMapper.deleteByPrimaryKey(id); UserGroupPermissionExample example = new UserGroupPermissionExample(); example.createCriteria().andGroupIdEqualTo(id); diff --git a/frontend/src/business/components/settings/system/group/EditUserGroup.vue b/frontend/src/business/components/settings/system/group/EditUserGroup.vue index 3ab855114d..352d63b0b8 100644 --- a/frontend/src/business/components/settings/system/group/EditUserGroup.vue +++ b/frontend/src/business/components/settings/system/group/EditUserGroup.vue @@ -1,6 +1,6 @@