From c946b7ba86c04ba502735fea0f560678a15ff77a Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 8 Jul 2021 17:43:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E5=91=98=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=88=90=E5=91=98=E9=97=AE=E9=A2=98#1004968?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/controller/UserController.java | 9 ++++----- .../settings/organization/OrganizationMember.vue | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index a97a8553f4..c9ac591ab4 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -229,11 +229,10 @@ public class UserController { @GetMapping("/project/member/delete/{projectId}/{userId}") // @MsAuditLog(module = "workspace_member", type = OperLogConstants.DELETE, title = "删除工作空间成员") public void deleteProjectMember(@PathVariable String projectId, @PathVariable String userId) { -// workspaceService.checkWorkspaceOwner(workspaceId); -// String currentUserId = SessionUtils.getUser().getId(); -// if (StringUtils.equals(userId, currentUserId)) { -// MSException.throwException(Translator.get("cannot_remove_current")); -// } + String currentUserId = SessionUtils.getUser().getId(); + if (StringUtils.equals(userId, currentUserId)) { + MSException.throwException(Translator.get("cannot_remove_current")); + } userService.deleteProjectMember(projectId, userId); } diff --git a/frontend/src/business/components/settings/organization/OrganizationMember.vue b/frontend/src/business/components/settings/organization/OrganizationMember.vue index d8a622c799..14690171f9 100644 --- a/frontend/src/business/components/settings/organization/OrganizationMember.vue +++ b/frontend/src/business/components/settings/organization/OrganizationMember.vue @@ -170,12 +170,12 @@ initTableData() { let param = { name: this.condition.name, - organizationId: this.currentUser().lastOrganizationId + organizationId: this.orgId }; this.result = this.$post(this.buildPagePath(this.queryPath), param, response => { let data = response.data; this.tableData = data.listObject; - let url = "/user/group/list/org/" + this.currentUser().lastOrganizationId; + let url = "/user/group/list/org/" + this.orgId; for (let i = 0; i < this.tableData.length; i++) { this.$get(url + "/" + encodeURIComponent(this.tableData[i].id), response => { let groups = response.data; @@ -227,7 +227,7 @@ this.updateVisible = true; this.form = Object.assign({}, row); let groupIds = this.form.groups.map(r => r.id); - this.result = this.$post('/user/group/list', {type: GROUP_ORGANIZATION, resourceId: this.currentUser().lastOrganizationId}, response => { + this.result = this.$post('/user/group/list', {type: GROUP_ORGANIZATION, resourceId: this.orgId}, response => { this.$set(this.form, "allgroups", response.data); }) // 编辑使填充角色信息 @@ -241,7 +241,7 @@ email: this.form.email, phone: this.form.phone, groupIds: this.form.groupIds, - organizationId: this.currentUser().lastOrganizationId + organizationId: this.orgId }; this.$refs[formName].validate((valid) => { if (valid) { @@ -259,7 +259,7 @@ cancelButtonText: this.$t('commons.cancel'), type: 'warning' }).then(() => { - this.result = this.$get('/user/org/member/delete/' + this.currentUser().lastOrganizationId + '/' + encodeURIComponent(row.id), () => { + this.result = this.$get('/user/org/member/delete/' + this.orgId + '/' + encodeURIComponent(row.id), () => { this.$success(this.$t('commons.remove_success')); this.initTableData(); });