fix(接口测试): 修复无mock权限的用户点击编辑提示无权限的缺陷

--bug=1027559 --user=王孝刚 【接口测试】只读用户有接口执行权限-api列表点击执行提示无权限
https://www.tapd.cn/55049933/s/1389300
This commit is contained in:
wxg0103 2023-07-04 17:04:45 +08:00 committed by fit2-zhao
parent c936dfa228
commit 0b8006c6af
1 changed files with 2 additions and 1 deletions

View File

@ -143,6 +143,7 @@ import { getProjectMemberOption } from '@/api/project';
import { buildCustomFields, parseCustomField } from 'metersphere-frontend/src/utils/custom_field';
import { getApiTemplate } from '@/api/api-template';
import { parseCustomFilesForItem } from 'metersphere-frontend/src/utils/tableUtils';
import { hasPermissions } from 'metersphere-frontend/src/utils/permission';
const store = useApiStore();
export default {
name: 'EditCompleteContainer',
@ -209,7 +210,7 @@ export default {
}
this.customFieldForm = parseCustomField(this.currentApi, this.apiTemplate, this.customFieldRules);
});
if (this.currentApi.id && (this.currentProtocol === 'HTTP' || this.currentProtocol === 'TCP')) {
if (this.currentApi.id && (this.currentProtocol === 'HTTP' || this.currentProtocol === 'TCP') && hasPermissions('PROJECT_API_DEFINITION:READ+MOCK')) {
this.mockSetting();
}
this.formatApi();