fix(系统设置): 一级模块权限控制问题

--bug=1015843 --user=李玉号 【系统设置】用户组与权限,只有首页查看权限的时候,看不到一级模块
https://www.tapd.cn/55049933/s/1224091
This commit is contained in:
shiziyuan9527 2022-08-16 12:39:21 +08:00 committed by f2c-ci-robot[bot]
parent 9e01b59843
commit 323db4c377
3 changed files with 15 additions and 10 deletions

View File

@ -181,16 +181,21 @@ public class ApiDefinitionService {
buildProjectInfo(resList, request.getProjectId()); buildProjectInfo(resList, request.getProjectId());
calculateResult(resList, request.getProjectId()); calculateResult(resList, request.getProjectId());
} else { } else {
buildProjectInfoWidthoutProject(resList); buildProjectInfoWithoutProject(resList);
} }
return resList; return resList;
} }
private void buildProjectInfoWidthoutProject(List<ApiDefinitionResult> resList) { private void buildProjectInfoWithoutProject(List<ApiDefinitionResult> resList) {
resList.forEach(i -> { resList.forEach(i -> {
Project project = projectMapper.selectByPrimaryKey(i.getProjectId()); Project project = projectMapper.selectByPrimaryKey(i.getProjectId());
i.setProjectName(project.getName()); if (project == null) {
i.setVersionEnable(project.getVersionEnable()); i.setProjectName("");
i.setVersionEnable(false);
} else {
i.setProjectName(project.getName());
i.setVersionEnable(project.getVersionEnable());
}
}); });
} }

View File

@ -12,11 +12,11 @@
{{ $t('commons.my_workstation') }} {{ $t('commons.my_workstation') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/track" v-if="check('testTrack')" onselectstart="return false" <el-menu-item index="/track" v-if="check('testTrack')" onselectstart="return false"
v-permission="['PROJECT_TRACK_CASE:READ','PROJECT_TRACK_PLAN:READ','PROJECT_TRACK_REVIEW:READ', 'PROJECT_TRACK_ISSUE:READ', 'PROJECT_TRACK_REPORT:READ']"> 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') }} {{ $t('test_track.test_track') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/api" @click="active()" v-if="check('api')" onselectstart="return false" <el-menu-item index="/api" @click="active()" v-if="check('api')" onselectstart="return false"
v-permission="['PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ']"> v-permission="['PROJECT_API_HOME:READ', 'PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ']">
{{ $t('commons.api') }} {{ $t('commons.api') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/ui" @click="active()" v-if="hasLicense() && check('ui')" onselectstart="return false" <el-menu-item index="/ui" @click="active()" v-if="hasLicense() && check('ui')" onselectstart="return false"
@ -28,7 +28,7 @@
</el-menu-item> </el-menu-item>
<el-menu-item index="/performance" v-if="check('performance')" <el-menu-item index="/performance" v-if="check('performance')"
onselectstart="return false" onselectstart="return false"
v-permission="['PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']"> v-permission="['PROJECT_PERFORMANCE_HOME:READ', 'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']">
{{ $t('commons.performance') }} {{ $t('commons.performance') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/report" v-if="check('reportStat')" onselectstart="return false" <el-menu-item index="/report" v-if="check('reportStat')" onselectstart="return false"

View File

@ -15,14 +15,14 @@
</div> </div>
</el-menu-item> </el-menu-item>
<el-menu-item index="/track" v-if="check('testTrack')" onselectstart="return false" <el-menu-item index="/track" v-if="check('testTrack')" onselectstart="return false"
v-permission="['PROJECT_TRACK_CASE:READ','PROJECT_TRACK_PLAN:READ','PROJECT_TRACK_REVIEW:READ', 'PROJECT_TRACK_ISSUE:READ', 'PROJECT_TRACK_REPORT:READ']"> 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']">
<div> <div>
<svg-icon iconClass="track" class-name="ms-menu-img"/> <svg-icon iconClass="track" class-name="ms-menu-img"/>
<span slot="title" class="ms-menu-item-title">{{ $t('test_track.test_track') }}</span> <span slot="title" class="ms-menu-item-title">{{ $t('test_track.test_track') }}</span>
</div> </div>
</el-menu-item> </el-menu-item>
<el-menu-item index="/api" @click="active()" v-if="check('api')" onselectstart="return false" <el-menu-item index="/api" @click="active()" v-if="check('api')" onselectstart="return false"
v-permission="['PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ']"> v-permission="['PROJECT_API_HOME:READ', 'PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ']">
<div> <div>
<svg-icon iconClass="api" class-name="ms-menu-img"/> <svg-icon iconClass="api" class-name="ms-menu-img"/>
<span slot="title" class="ms-menu-item-title">{{ $t('commons.api') }}</span> <span slot="title" class="ms-menu-item-title">{{ $t('commons.api') }}</span>
@ -43,7 +43,7 @@
</el-menu-item> </el-menu-item>
<el-menu-item index="/performance" v-if="check('performance')" <el-menu-item index="/performance" v-if="check('performance')"
onselectstart="return false" onselectstart="return false"
v-permission="['PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']"> v-permission="['PROJECT_PERFORMANCE_HOME:READ', 'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']">
<div> <div>
<svg-icon iconClass="performance" class-name="ms-menu-img"/> <svg-icon iconClass="performance" class-name="ms-menu-img"/>
<span slot="title" class="ms-menu-item-title">{{ $t('commons.performance') }}</span> <span slot="title" class="ms-menu-item-title">{{ $t('commons.performance') }}</span>