fix(系统设置): 项目管理员移除成员问题#1004968

This commit is contained in:
shiziyuan9527 2021-07-08 17:43:28 +08:00 committed by 刘瑞斌
parent 622d92aff4
commit c946b7ba86
2 changed files with 9 additions and 10 deletions

View File

@ -229,11 +229,10 @@ public class UserController {
@GetMapping("/project/member/delete/{projectId}/{userId}") @GetMapping("/project/member/delete/{projectId}/{userId}")
// @MsAuditLog(module = "workspace_member", type = OperLogConstants.DELETE, title = "删除工作空间成员") // @MsAuditLog(module = "workspace_member", type = OperLogConstants.DELETE, title = "删除工作空间成员")
public void deleteProjectMember(@PathVariable String projectId, @PathVariable String userId) { public void deleteProjectMember(@PathVariable String projectId, @PathVariable String userId) {
// workspaceService.checkWorkspaceOwner(workspaceId); String currentUserId = SessionUtils.getUser().getId();
// String currentUserId = SessionUtils.getUser().getId(); if (StringUtils.equals(userId, currentUserId)) {
// if (StringUtils.equals(userId, currentUserId)) { MSException.throwException(Translator.get("cannot_remove_current"));
// MSException.throwException(Translator.get("cannot_remove_current")); }
// }
userService.deleteProjectMember(projectId, userId); userService.deleteProjectMember(projectId, userId);
} }

View File

@ -170,12 +170,12 @@
initTableData() { initTableData() {
let param = { let param = {
name: this.condition.name, name: this.condition.name,
organizationId: this.currentUser().lastOrganizationId organizationId: this.orgId
}; };
this.result = this.$post(this.buildPagePath(this.queryPath), param, response => { this.result = this.$post(this.buildPagePath(this.queryPath), param, response => {
let data = response.data; let data = response.data;
this.tableData = data.listObject; 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++) { for (let i = 0; i < this.tableData.length; i++) {
this.$get(url + "/" + encodeURIComponent(this.tableData[i].id), response => { this.$get(url + "/" + encodeURIComponent(this.tableData[i].id), response => {
let groups = response.data; let groups = response.data;
@ -227,7 +227,7 @@
this.updateVisible = true; this.updateVisible = true;
this.form = Object.assign({}, row); this.form = Object.assign({}, row);
let groupIds = this.form.groups.map(r => r.id); 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); this.$set(this.form, "allgroups", response.data);
}) })
// 使 // 使
@ -241,7 +241,7 @@
email: this.form.email, email: this.form.email,
phone: this.form.phone, phone: this.form.phone,
groupIds: this.form.groupIds, groupIds: this.form.groupIds,
organizationId: this.currentUser().lastOrganizationId organizationId: this.orgId
}; };
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
@ -259,7 +259,7 @@
cancelButtonText: this.$t('commons.cancel'), cancelButtonText: this.$t('commons.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).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.$success(this.$t('commons.remove_success'));
this.initTableData(); this.initTableData();
}); });