refactor(系统设置): 优化特殊字符报错的缺陷

This commit is contained in:
wxg0103 2024-06-05 16:30:00 +08:00 committed by 刘瑞斌
parent ffef216687
commit 4180d40a12
2 changed files with 16 additions and 18 deletions

View File

@ -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<Map<String, Object>> getAllUserGroup(@PathVariable("userId") String userId) {
public List<Map<String, Object>> getAllUserGroup(@RequestBody String userId) {
return groupService.getAllUserGroup(userId);
}

View File

@ -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<unknown>}
*/
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);
}