diff --git a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java index cf28ff597f..34d698bd41 100644 --- a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java +++ b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java @@ -331,8 +331,12 @@ public class DashboardService { UserLayout userLayout = new UserLayout(); userLayout.setUserId(userId); userLayout.setOrgId(organizationId); - String configuration = JSON.toJSONString(saveList); - userLayout.setConfiguration(configuration.getBytes()); + if (CollectionUtils.isEmpty(saveList)) { + userLayout.setConfiguration(new byte[0]); + } else { + String configuration = JSON.toJSONString(saveList); + userLayout.setConfiguration(configuration.getBytes()); + } if (CollectionUtils.isEmpty(userLayouts)) { userLayout.setId(IDGenerator.nextStr()); userLayoutMapper.insert(userLayout); @@ -347,7 +351,7 @@ public class DashboardService { UserLayoutExample userLayoutExample = new UserLayoutExample(); userLayoutExample.createCriteria().andUserIdEqualTo(userId).andOrgIdEqualTo(organizationId); List userLayouts = userLayoutMapper.selectByExampleWithBLOBs(userLayoutExample); - List allPermissionProjects = extProjectMapper.getUserProjectIdName(organizationId, null, userId); + ListallPermissionProjects = extProjectMapper.getProjectNameModule(organizationId, null); if (CollectionUtils.isEmpty(allPermissionProjects)) { return new ArrayList<>(); } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.java b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.java index dfe1afd227..7f0f1ca42a 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.java @@ -34,14 +34,6 @@ public interface ExtProjectMapper { List getProjectNameModule(@Param("organizationId") String organizationId, @Param("ids") ListprojectIds); - /** - * 获取用户在所选项目中仍然有任意权限的项目 - * @param organizationId 组织id - * @param projectIds 所选项目ids - * @param userId 用户 - * @return List - */ - List getUserProjectIdName(@Param("organizationId") String organizationId, @Param("ids") ListprojectIds, @Param("userId") String userId); } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.xml b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.xml index d96048f300..166a84d5d2 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.xml +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMapper.xml @@ -132,27 +132,4 @@ - - - \ No newline at end of file