refactor(项目设置): 添加成员只展示所属空间的成员列表

--story=1006218 --user=李玉号 项目添加成员只展示所属空间的成员列表
https://www.tapd.cn/55049933/s/1130533
This commit is contained in:
shiziyuan9527 2022-04-06 17:53:31 +08:00 committed by shiziyuan9527
parent 76ad13e7d0
commit 1eb9c1f8e6
3 changed files with 21 additions and 2 deletions

View File

@ -158,12 +158,20 @@ public class UserController {
return userService.getMemberList(request);
}
@GetMapping("/ws/current/member/list")
public List<User> getCurrentWorkspaceMember() {
QueryMemberRequest request = new QueryMemberRequest();
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return userService.getMemberList(request);
}
/**
* 添加工作空间成员
*/
@PostMapping("/ws/member/add")
@MsAuditLog(module = OperLogModule.WORKSPACE_MEMBER, type = OperLogConstants.CREATE, title = "添加工作空间成员")
public void addMember(@RequestBody AddMemberRequest request) {
String wsId = request.getWorkspaceId();
// workspaceService.checkWorkspaceOwner(wsId);
userService.addMember(request);

View File

@ -1,5 +1,9 @@
<template>
<add-member :group-type="GROUP_PROJECT" :group-scope-id="workspaceId" ref="addMember" @submit="submit"/>
<add-member :group-type="GROUP_PROJECT"
:group-scope-id="workspaceId"
ref="addMember"
@submit="submit"
:user-resource-url="userResourceUrl"/>
</template>
<script>
@ -23,6 +27,7 @@ export default {
]
},
userList: [],
userResourceUrl: 'user/ws/current/member/list'
};
},
computed: {

View File

@ -80,6 +80,12 @@ export default {
default() {
return '';
}
},
userResourceUrl: {
type: String,
default() {
return '/user/list/';
}
}
},
methods: {
@ -96,7 +102,7 @@ export default {
},
open() {
this.dialogVisible = true;
this.result = this.$get('/user/list/', response => {
this.result = this.$get(this.userResourceUrl, response => {
this.userList = response.data;
this.copyUserList = response.data;
})