diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index cfec03c6eb..be5d3ea855 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -181,16 +181,21 @@ public class ApiDefinitionService { buildProjectInfo(resList, request.getProjectId()); calculateResult(resList, request.getProjectId()); } else { - buildProjectInfoWidthoutProject(resList); + buildProjectInfoWithoutProject(resList); } return resList; } - private void buildProjectInfoWidthoutProject(List resList) { + private void buildProjectInfoWithoutProject(List resList) { resList.forEach(i -> { Project project = projectMapper.selectByPrimaryKey(i.getProjectId()); - i.setProjectName(project.getName()); - i.setVersionEnable(project.getVersionEnable()); + if (project == null) { + i.setProjectName(""); + i.setVersionEnable(false); + } else { + i.setProjectName(project.getName()); + i.setVersionEnable(project.getVersionEnable()); + } }); } diff --git a/frontend/src/business/components/common/head/HeaderTopMenus.vue b/frontend/src/business/components/common/head/HeaderTopMenus.vue index 7c08d36d07..ce95449b81 100644 --- a/frontend/src/business/components/common/head/HeaderTopMenus.vue +++ b/frontend/src/business/components/common/head/HeaderTopMenus.vue @@ -12,11 +12,11 @@ {{ $t('commons.my_workstation') }} + v-permission="['PROJECT_TRACK_HOME:READ', 'PROJECT_TRACK_CASE:READ','PROJECT_TRACK_PLAN:READ','PROJECT_TRACK_REVIEW:READ', 'PROJECT_TRACK_ISSUE:READ', 'PROJECT_TRACK_REPORT:READ']"> {{ $t('test_track.test_track') }} + v-permission="['PROJECT_API_HOME:READ', 'PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ']"> {{ $t('commons.api') }} + v-permission="['PROJECT_PERFORMANCE_HOME:READ', 'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']"> {{ $t('commons.performance') }} + v-permission="['PROJECT_TRACK_HOME:READ', 'PROJECT_TRACK_CASE:READ','PROJECT_TRACK_PLAN:READ','PROJECT_TRACK_REVIEW:READ', 'PROJECT_TRACK_ISSUE:READ', 'PROJECT_TRACK_REPORT:READ']">
{{ $t('test_track.test_track') }}
+ v-permission="['PROJECT_API_HOME:READ', 'PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ']">
{{ $t('commons.api') }} @@ -43,7 +43,7 @@ + v-permission="['PROJECT_PERFORMANCE_HOME:READ', 'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']">
{{ $t('commons.performance') }}