From 41535f574b84920cc6659dec4b9a7c87421ecbd3 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 9 Jun 2022 12:46:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013901 --user=刘瑞斌 【接口权限】使用系统自定义的无任何权限的系统管理员账号,可以查看工作空间、项目、用户等 https://www.tapd.cn/55049933/s/1177397 --bug=1013910 --user=刘瑞斌 【系统设置】用户组与权限列表,点击成员数量报错 https://www.tapd.cn/55049933/s/1177649 --bug=1013900 --user=刘瑞斌 【接口权限】使用自定义的系统管理员账号,可用接口创建项目 https://www.tapd.cn/55049933/s/1177656 --bug=1013911 --user=刘瑞斌 【接口权限】工作空间管理员问题汇总 https://www.tapd.cn/55049933/s/1177705 --- .../controller/ProjectController.java | 8 ++++-- .../controller/UserController.java | 26 +++++++------------ .../controller/WorkspaceController.java | 15 +++++------ .../io/metersphere/service/UserService.java | 8 ------ .../track/service/TestCaseReviewService.java | 2 +- .../automation/scenario/AddBasisScenario.vue | 2 +- .../automation/scenario/ApiScenarioList.vue | 2 +- .../automation/scenario/EditApiScenario.vue | 2 +- .../automation/scenario/api/AddBasisApi.vue | 2 +- .../automation/schedule/ScheduleMaintain.vue | 2 +- .../api/definition/components/ApiConfig.vue | 2 +- .../components/basis/AddBasisApi.vue | 2 +- .../components/case/ApiCaseList.vue | 2 +- .../components/import/ApiSchedule.vue | 2 +- .../definition/components/list/ApiList.vue | 2 +- .../common/components/MsScheduleEdit.vue | 2 +- .../components/common/head/HeaderWs.vue | 2 +- .../performance/test/EditPerformanceTest.vue | 2 +- .../performance/test/PerformanceTestList.vue | 2 +- .../project/notification/TaskNotification.vue | 2 +- .../track/filter/TestAnalysisFilter.vue | 2 +- .../settings/operatinglog/OperatingLog.vue | 2 +- .../settings/system/group/GroupMember.vue | 25 ++++++++++-------- .../settings/workspace/MsProject.vue | 6 ++--- .../business/components/task/TaskCenter.vue | 2 +- .../track/case/components/TestCaseCreate.vue | 2 +- .../track/case/components/TestCaseEdit.vue | 2 +- .../case/components/TestCaseEditShow.vue | 2 +- .../track/case/components/TestCaseList.vue | 2 +- .../case/version/TestCaseVersionDiff.vue | 2 +- .../components/track/issue/IssueList.vue | 2 +- .../plan/components/ScheduleMaintain.vue | 2 +- .../track/plan/components/TestPlanEdit.vue | 2 +- .../plan/view/comonents/ExecutorEdit.vue | 2 +- .../comonents/api/TestPlanApiCaseList.vue | 2 +- .../comonents/base/TestCaseRelevanceBase.vue | 2 +- .../functional/FunctionalTestCaseList.vue | 2 +- .../review/components/TestCaseReviewEdit.vue | 2 +- frontend/src/network/user.js | 4 +-- 39 files changed, 73 insertions(+), 83 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index 061b53a3a0..6a0e1d6b0d 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -18,6 +18,7 @@ import io.metersphere.dto.WorkspaceMemberDTO; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.service.CheckPermissionService; import io.metersphere.service.ProjectService; +import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -38,6 +39,7 @@ public class ProjectController { private ApiTestEnvironmentService apiTestEnvironmentService; @GetMapping("/listAll") + @RequiresPermissions(PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ) public List listAll() { String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); ProjectRequest request = new ProjectRequest(); @@ -47,7 +49,8 @@ public class ProjectController { /*jenkins项目列表*/ @GetMapping("/listAll/{workspaceId}") - public List jlistAll(@PathVariable String workspaceId) { + @RequiresPermissions(PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ) + public List listAll(@PathVariable String workspaceId) { ProjectRequest request = new ProjectRequest(); request.setWorkspaceId(workspaceId); return projectService.getProjectList(request); @@ -83,6 +86,7 @@ public class ProjectController { } @PostMapping("/list/{goPage}/{pageSize}") + @RequiresPermissions(PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ) public Pager> getProjectList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ProjectRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, projectService.getProjectList(request)); @@ -109,7 +113,7 @@ public class ProjectController { @PostMapping("/update") @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_MANAGER, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#Project.id)", content = "#msClass.getLogDetails(#Project.id)", msClass = ProjectService.class) - @RequiresPermissions(PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_EDIT) + @RequiresPermissions(value = {PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_EDIT, PermissionConstants.PROJECT_MANAGER_READ_EDIT}, logical = Logical.OR) public void updateProject(@RequestBody AddProjectRequest Project) { projectService.updateProject(Project); } diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index aceb33f869..2130652b0f 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -45,6 +45,7 @@ public class UserController { } @PostMapping("/special/list/{goPage}/{pageSize}") + @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ) public Pager> getUserList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody io.metersphere.controller.request.UserRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, userService.getUserListWithRequest(request)); @@ -79,12 +80,14 @@ public class UserController { } @PostMapping("/special/ws/member/list/{goPage}/{pageSize}") + @RequiresPermissions(PermissionConstants.SYSTEM_WORKSPACE_READ) public Pager> getMemberListByAdmin(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, userService.getMemberList(request)); } @PostMapping("/special/ws/member/list/all") + @RequiresPermissions(PermissionConstants.SYSTEM_WORKSPACE_READ) public List getMemberListByAdmin(@RequestBody QueryMemberRequest request) { return userService.getMemberList(request); } @@ -144,19 +147,23 @@ public class UserController { * 获取工作空间成员用户 */ @PostMapping("/ws/member/list/{goPage}/{pageSize}") + @RequiresPermissions(PermissionConstants.WORKSPACE_USER_READ) public Pager> getMemberList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, userService.getMemberList(request)); } @PostMapping("/project/member/list/{goPage}/{pageSize}") + @RequiresPermissions(PermissionConstants.PROJECT_USER_READ) public Pager> getProjectMemberList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, userService.getProjectMemberList(request)); } - @PostMapping("/project/member/list") - public List getProjectMemberListAll(@RequestBody QueryMemberRequest request) { + @GetMapping("/project/member/list") + public List getProjectMemberListAll() { + QueryMemberRequest request = new QueryMemberRequest(); + request.setProjectId(SessionUtils.getCurrentProjectId()); return userService.getProjectMemberList(request); } @@ -169,6 +176,7 @@ public class UserController { * 获取工作空间成员用户 不分页 */ @PostMapping("/ws/member/list/all") + @RequiresPermissions(PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ) public List getMemberList(@RequestBody QueryMemberRequest request) { return userService.getMemberList(request); } @@ -223,15 +231,6 @@ public class UserController { userService.deleteProjectMember(projectId, userId); } - - /** - * ws 下所有相关人员 - */ - @GetMapping("/ws/member/list/{workspaceId}") - public List getWsMemberList(@PathVariable String workspaceId) { - return userService.getWsAllMember(workspaceId); - } - /* * 修改当前用户密码 * */ @@ -249,11 +248,6 @@ public class UserController { return userService.updateUserPassword(request); } - @PostMapping("/project/member/tester/list") - public List getProjectMember(@RequestBody QueryMemberRequest request) { - return userService.getProjectMember(request); - } - @GetMapping("/search/{condition}") public List searchUser(@PathVariable String condition) { return userService.searchUser(condition); diff --git a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java index fe078af843..be2f66c9ce 100644 --- a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java +++ b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java @@ -8,6 +8,7 @@ import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; +import io.metersphere.commons.utils.SessionUtils; import io.metersphere.controller.request.WorkspaceRequest; import io.metersphere.dto.WorkspaceDTO; import io.metersphere.dto.WorkspaceMemberDTO; @@ -15,6 +16,7 @@ import io.metersphere.dto.WorkspaceResource; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.service.UserService; import io.metersphere.service.WorkspaceService; +import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.*; @@ -63,21 +65,16 @@ public class WorkspaceController { workspaceService.deleteWorkspace(workspaceId); } - @PostMapping("list/{goPage}/{pageSize}") - public Pager> getWorkspaceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody WorkspaceRequest request) { - Page page = PageHelper.startPage(goPage, pageSize, true); - return PageUtils.setPageInfo(page, workspaceService.getWorkspaceList(request)); - } - @PostMapping("list/all/{goPage}/{pageSize}") + @RequiresPermissions(PermissionConstants.SYSTEM_WORKSPACE_READ) public Pager> getAllWorkspaceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody WorkspaceRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, workspaceService.getAllWorkspaceList(request)); } - @GetMapping("/list/userworkspace/{userId}") - public List getWorkspaceListByUserId(@PathVariable String userId) { - return workspaceService.getWorkspaceListByUserId(userId); + @GetMapping("/list/userworkspace") + public List getWorkspaceListByUserId() { + return workspaceService.getWorkspaceListByUserId(SessionUtils.getUserId()); } @PostMapping("/member/update") diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index a9a5388180..36f746f67a 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -1182,14 +1182,6 @@ public class UserService { userGroupMapper.deleteByExample(userGroupExample); } - public List getProjectMember(QueryMemberRequest request) { - String projectId = request.getProjectId(); - if (StringUtils.isBlank(projectId)) { - return new ArrayList<>(); - } - return extUserGroupMapper.getProjectMemberList(request); - } - public List getWsAllMember(String workspaceId) { List sourceIds = new ArrayList<>(); ProjectExample projectExample = new ProjectExample(); diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java index b546ad017d..af299e6653 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java @@ -485,7 +485,7 @@ public class TestCaseReviewService { private String getReviewName(List userIds, String projectId) { QueryMemberRequest queryMemberRequest = new QueryMemberRequest(); queryMemberRequest.setProjectId(projectId); - Map userMap = userService.getProjectMember(queryMemberRequest) + Map userMap = userService.getProjectMemberList(queryMemberRequest) .stream().collect(Collectors.toMap(User::getId, User::getName)); StringBuilder stringBuilder = new StringBuilder(); String name = ""; diff --git a/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue b/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue index 09ef12a413..fe86aa0410 100644 --- a/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue @@ -127,7 +127,7 @@ } }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.userOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 741fe84dc2..c2fe4cb573 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -837,7 +837,7 @@ export default { } }, getPrincipalOptions(option) { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { option.push(...response.data); this.userFilters = response.data.map(u => { return {text: u.name, value: u.id}; diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index a5855a2bdd..bfc80dc3cc 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -1367,7 +1367,7 @@ export default { this.cancelBatchProcessing(); }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue b/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue index 4b4fc54741..e5d61c8339 100644 --- a/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue +++ b/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue @@ -247,7 +247,7 @@ this.httpForm.request = createComponent("DubboSampler"); }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => { + this.$get('/user/project/member/list', response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue index d71d37b315..e74c260c16 100644 --- a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue +++ b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue @@ -291,7 +291,7 @@ export default { }); }, initUserList() { - this.result = this.$post('/user/project/member/list', {projectId: getCurrentProjectID()}, response => { + this.result = this.$get('/user/project/member/list', response => { this.scheduleReceiverOptions = response.data; }); diff --git a/frontend/src/business/components/api/definition/components/ApiConfig.vue b/frontend/src/business/components/api/definition/components/ApiConfig.vue index ff85ace9aa..98677503f1 100644 --- a/frontend/src/business/components/api/definition/components/ApiConfig.vue +++ b/frontend/src/business/components/api/definition/components/ApiConfig.vue @@ -169,7 +169,7 @@ this.$emit("createRootModel"); }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue b/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue index 6eb5b39e5f..40b9fdc482 100644 --- a/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue +++ b/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue @@ -195,7 +195,7 @@ this.httpForm.request = createComponent("DubboSampler"); }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue index c62ea93d33..d1f7c8d63f 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue @@ -139,7 +139,7 @@ export default { }, methods: { getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue b/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue index 9f79e8bfdc..07a3993ceb 100644 --- a/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue +++ b/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue @@ -249,7 +249,7 @@ export default { }, initUserList() { - this.result = this.$post('/user/project/member/list', {projectId: getCurrentProjectID()}, response => { + this.result = this.$get('/user/project/member/list', response => { this.scheduleReceiverOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index 8515910f48..6e33db4c39 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -655,7 +655,7 @@ export default { } }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.valueArr.userId = response.data; this.userFilters = response.data.map(u => { return {text: u.name, value: u.id}; diff --git a/frontend/src/business/components/common/components/MsScheduleEdit.vue b/frontend/src/business/components/common/components/MsScheduleEdit.vue index 666f3fab06..9624532e3b 100644 --- a/frontend/src/business/components/common/components/MsScheduleEdit.vue +++ b/frontend/src/business/components/common/components/MsScheduleEdit.vue @@ -131,7 +131,7 @@ export default { initUserList() { - this.result = this.$post('/user/project/member/list', {projectId: getCurrentProjectID()}, response => { + this.result = this.$get('/user/project/member/list', response => { this.scheduleReceiverOptions = response.data; }); diff --git a/frontend/src/business/components/common/head/HeaderWs.vue b/frontend/src/business/components/common/head/HeaderWs.vue index 7ca1dd4f63..2b141712ce 100644 --- a/frontend/src/business/components/common/head/HeaderWs.vue +++ b/frontend/src/business/components/common/head/HeaderWs.vue @@ -72,7 +72,7 @@ export default { methods: { getCurrentWorkspaceId, initMenuData() { - this.$get("/workspace/list/userworkspace/" + encodeURIComponent(this.currentUserId), response => { + this.$get("/workspace/list/userworkspace", response => { this.workspaceList = response.data; this.wsListCopy = response.data; let workspace = response.data.filter(r => r.id === getCurrentWorkspaceId()); diff --git a/frontend/src/business/components/performance/test/EditPerformanceTest.vue b/frontend/src/business/components/performance/test/EditPerformanceTest.vue index 4f82267a69..23e5a27c8d 100644 --- a/frontend/src/business/components/performance/test/EditPerformanceTest.vue +++ b/frontend/src/business/components/performance/test/EditPerformanceTest.vue @@ -198,7 +198,7 @@ export default { return getCurrentUser(); }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/performance/test/PerformanceTestList.vue b/frontend/src/business/components/performance/test/PerformanceTestList.vue index 8fe8b223c3..5fdc58d205 100644 --- a/frontend/src/business/components/performance/test/PerformanceTestList.vue +++ b/frontend/src/business/components/performance/test/PerformanceTestList.vue @@ -223,7 +223,7 @@ export default { methods: { getMaintainerOptions() { let workspaceId = getCurrentWorkspaceId(); - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.userFilters = response.data.map(u => { return {text: u.name, value: u.id}; }); diff --git a/frontend/src/business/components/project/notification/TaskNotification.vue b/frontend/src/business/components/project/notification/TaskNotification.vue index 1345362295..fe89c0507c 100644 --- a/frontend/src/business/components/project/notification/TaskNotification.vue +++ b/frontend/src/business/components/project/notification/TaskNotification.vue @@ -161,7 +161,7 @@ export default { }, initUserList() { - this.result = this.$post('/user/project/member/list', {projectId: getCurrentProjectID()}, response => { + this.result = this.$get('/user/project/member/list', response => { this.jenkinsReceiverOptions = response.data; this.reviewReceiverOptions = response.data; this.defectReceiverOptions = response.data; diff --git a/frontend/src/business/components/reportstatistics/projectstatistics/track/filter/TestAnalysisFilter.vue b/frontend/src/business/components/reportstatistics/projectstatistics/track/filter/TestAnalysisFilter.vue index 5cb3e70a8e..e4c518f857 100644 --- a/frontend/src/business/components/reportstatistics/projectstatistics/track/filter/TestAnalysisFilter.vue +++ b/frontend/src/business/components/reportstatistics/projectstatistics/track/filter/TestAnalysisFilter.vue @@ -156,7 +156,7 @@ }) }, initUsers() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { + this.$get('/user/project/member/list', response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/settings/operatinglog/OperatingLog.vue b/frontend/src/business/components/settings/operatinglog/OperatingLog.vue index 29a91a90c7..5c3d891b27 100644 --- a/frontend/src/business/components/settings/operatinglog/OperatingLog.vue +++ b/frontend/src/business/components/settings/operatinglog/OperatingLog.vue @@ -305,7 +305,7 @@ export default { this.initTableData(); }, getWorkSpaceList() { - this.$get("/workspace/list/userworkspace/" + encodeURIComponent(getCurrentUserId()), response => { + this.$get("/workspace/list/userworkspace", response => { let workspaceList = response.data; let workspaceIds = []; if (workspaceList) { diff --git a/frontend/src/business/components/settings/system/group/GroupMember.vue b/frontend/src/business/components/settings/system/group/GroupMember.vue index 8c55efdcb9..83a323effd 100644 --- a/frontend/src/business/components/settings/system/group/GroupMember.vue +++ b/frontend/src/business/components/settings/system/group/GroupMember.vue @@ -140,7 +140,7 @@ export default { userIds: {required: true, message: this.$t('member.please_choose_member'), trigger: 'blur'}, sourceIds: {required: true, message: this.$t('group.select_belong_source'), trigger: 'blur'} } - } + }; }, computed: { typeLabel() { @@ -167,10 +167,12 @@ export default { this.total = itemCount; this.memberData = listObject; } - }) - this.$get("/project/get/" + getCurrentProjectID(), res => { - this.currentProject = res.data; }); + if (getCurrentProjectID()) { + this.$get("/project/get/" + getCurrentProjectID(), res => { + this.currentProject = res.data; + }); + } }, open(group, initUserGroupUrl, initUserUrl) { this.initUserGroupUrl = initUserGroupUrl ? initUserGroupUrl : "/user/group/user/"; @@ -206,7 +208,7 @@ export default { let sourceIds = data.map(d => d.id); this.$set(this.form, 'userIds', userIds); this.$set(this.form, 'sourceIds', sourceIds); - }) + }); }, editMember() { this.form.groupId = this.group.id; @@ -220,12 +222,12 @@ export default { } else { return false; } - }) + }); }, getUser() { this.memberResult = this.$get(this.initUserUrl, response => { this.users = response.data; - }) + }); }, removeMember(row) { this.$confirm(this.$t('member.remove_member').toString(), '', { @@ -251,7 +253,7 @@ export default { this.groupSource = []; this.sourceResult = this.$get('/user/group/source/' + row.id + "/" + this.group.id, res => { this.groupSource = res.data; - }) + }); }, addMember() { if (this.submitType === 'ADD') { @@ -272,7 +274,7 @@ export default { } else { return false; } - }) + }); }, getResource() { this.memberResult = this.$get('/workspace/list/resource/' + this.group.id + "/" + this.group.type, res => { @@ -280,7 +282,7 @@ export default { if (data) { this._setResource(this.group.type, data); } - }) + }); }, _setResource(type, data) { switch (type) { @@ -307,13 +309,14 @@ export default { this.userSelectDisable = false; } } -} +};