fix(接口测试): 前后置公共脚本按钮权限控制问题

--bug=1037565 --user=宋昌昌 【权限】用户没有公共脚本查看权限,显示了引用/插入公共脚本按钮,点击报错 https://www.tapd.cn/55049933/s/1481184
This commit is contained in:
song-cc-rock 2024-03-26 18:11:06 +08:00 committed by 刘瑞斌
parent 348e58443d
commit 5500973cf8
1 changed files with 4 additions and 1 deletions

View File

@ -48,7 +48,9 @@
<div class="flex items-center justify-between">
<a-radio-group v-model="condition.enableCommonScript" class="mb-[8px]" @change="emit('change')">
<a-radio :value="false">{{ t('apiTestDebug.manual') }}</a-radio>
<a-radio :value="true">{{ t('apiTestDebug.quote') }}</a-radio>
<a-radio v-if="hasAnyPermission(['PROJECT_CUSTOM_FUNCTION:READ'])" :value="true">{{
t('apiTestDebug.quote')
}}</a-radio>
</a-radio-group>
<div v-if="props.showAssociatedScene" class="flex items-center">
<a-switch
@ -488,6 +490,7 @@
import { getProtocolList } from '@/api/modules/api-test/common';
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
import { hasAnyPermission } from '@/utils/permission';
import type { ProtocolItem } from '@/models/apiTest/common';
import { ExecuteConditionProcessor, JSONPathExtract, RegexExtract, XPathExtract } from '@/models/apiTest/common';