diff --git a/system-setting/backend/src/main/java/io/metersphere/controller/GroupController.java b/system-setting/backend/src/main/java/io/metersphere/controller/GroupController.java index 8e7c30855a..793d055c03 100644 --- a/system-setting/backend/src/main/java/io/metersphere/controller/GroupController.java +++ b/system-setting/backend/src/main/java/io/metersphere/controller/GroupController.java @@ -14,21 +14,19 @@ import io.metersphere.commons.user.SessionUser; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.SessionUtils; +import io.metersphere.dto.GroupDTO; +import io.metersphere.dto.GroupPermissionDTO; +import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.log.annotation.MsRequestLog; import io.metersphere.request.GroupRequest; import io.metersphere.request.group.EditGroupRequest; import io.metersphere.request.group.EditGroupUserRequest; -import io.metersphere.dto.GroupDTO; -import io.metersphere.dto.GroupPermissionDTO; -import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.service.GroupService; -import org.apache.commons.lang3.StringUtils; +import jakarta.annotation.Resource; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; - import java.util.*; @@ -99,9 +97,9 @@ public class GroupController { groupService.editGroupPermission(editGroupRequest); } - @GetMapping("/all/{userId}") + @PostMapping("/all") @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_EDIT) - public List> getAllUserGroup(@PathVariable("userId") String userId) { + public List> getAllUserGroup(@RequestBody String userId) { return groupService.getAllUserGroup(userId); } diff --git a/system-setting/frontend/src/api/user-group.js b/system-setting/frontend/src/api/user-group.js index 8e9993ed79..5d9df7ecfd 100644 --- a/system-setting/frontend/src/api/user-group.js +++ b/system-setting/frontend/src/api/user-group.js @@ -1,4 +1,4 @@ -import {get, post} from 'metersphere-frontend/src/plugins/request'; +import { get, post } from "metersphere-frontend/src/plugins/request"; /** * param: {type: '', resourceId: ''} @@ -6,7 +6,7 @@ import {get, post} from 'metersphere-frontend/src/plugins/request'; * @returns {Promise | Promise} */ export function getUserGroupList(param) { - return post('/user/group/list', param); + return post("/user/group/list", param); } export function getWorkspaceMemberGroup(workspaceId, userId) { @@ -22,7 +22,7 @@ export function getUserGroupListByPage(goPage, pageSize, param) { } export function getAllUserGroupByType(param) { - return post('/user/group/get', param); + return post("/user/group/get", param); } export function getUserGroupsByTypeAndId(type, id) { @@ -38,19 +38,19 @@ export function delUserGroupById(groupId) { } export function getUserGroupPermission(param) { - return post('/user/group/permission', param); + return post("/user/group/permission", param); } export function modifyUserGroupPermission(param) { - return post('/user/group/permission/edit', param); + return post("/user/group/permission/edit", param); } export function createUserGroup(group) { - return post('/user/group/add', group); + return post("/user/group/add", group); } export function modifyUserGroup(group) { - return post('/user/group/edit', group); + return post("/user/group/edit", group); } export function getUserGroupByResourceUrlAndPage(url, goPage, pageSize, param) { @@ -62,7 +62,7 @@ export function getUserGroupSourceByUserIdAndGroupId(userId, groupId) { } export function modifyUserGroupMember(param) { - return post('/user/group/edit/member', param); + return post("/user/group/edit/member", param); } export function rmUserFromGroup(userId, groupId) { @@ -70,9 +70,9 @@ export function rmUserFromGroup(userId, groupId) { } export function addUser2Group(param) { - return post('/user/group/add/member', param); + return post("/user/group/add/member", param); } export function getUserAllGroups(userId) { - return get(`/user/group/all/${userId}`); + return post(`/user/group/all`, userId); }