fix(性能测试): 修复没有查看场景的权限点击同步场景后页面跳转的问题

--bug=1019677 --user=刘瑞斌 【性能测试】只有性能测试查看权限,同步场景按钮可以点,点了会报错 https://www.tapd.cn/55049933/s/1302474
This commit is contained in:
CaptainB 2022-11-23 14:09:41 +08:00 committed by 刘瑞斌
parent 275499002a
commit 582aa9c812
4 changed files with 7 additions and 7 deletions

View File

@ -48,11 +48,10 @@
</el-button>
<schedule-config :schedule="test.schedule" :save="saveCronExpression" @scheduleChange="saveSchedule"
v-permission="['PROJECT_PERFORMANCE_TEST:READ+SCHEDULE']"
v-if="hasPermission('PROJECT_PERFORMANCE_TEST:READ+SCHEDULE')"
:check-open="checkScheduleEdit" :test-id="testId" :custom-validate="durationValidate"/>
<ms-tip-button v-if="test.isNeedUpdate"
v-permission="['PROJECT_PERFORMANCE_TEST:READ+EDIT']"
<ms-tip-button v-if="test.isNeedUpdate && hasPermission('PROJECT_PERFORMANCE_TEST:READ+EDIT')"
class="sync-btn" type="primary" size="small" circle
icon="el-icon-connection"
@click="syncScenario"
@ -213,6 +212,7 @@ export default {
this.getMaintainerOptions();
},
methods: {
hasPermission,
currentUser: () => {
return getCurrentUser();
},
@ -416,7 +416,7 @@ export default {
return formData;
},
syncScenario() {
if (!hasPermission('PROJECT_API_SCENARIO:READ')) {
if (!hasPermission('PROJECT_API_SCENARIO:READ+CREATE')) {
this.$warning(this.$t('performance_test.sync_scenario_no_permission_tips'));
return;
}

View File

@ -8,7 +8,7 @@ const message = {
test_duration: '{0} hours {1} minutes {2} seconds',
test_duration_tips: 'Execution Time{0} hours {1} minutes {2} seconds',
},
sync_scenario_no_permission_tips: 'No permission to view the interface cannot perform synchronization',
sync_scenario_no_permission_tips: 'No permission to create the scenario cannot perform synchronization',
}
}
export default {

View File

@ -8,7 +8,7 @@ const message = {
test_duration: '{0}时{1}分{2}秒',
test_duration_tips: '执行时长:{0}时{1}分{2}秒',
},
sync_scenario_no_permission_tips: '没有查看接口的权限无法执行同步',
sync_scenario_no_permission_tips: '没有创建接口的权限无法执行同步',
}
}

View File

@ -8,7 +8,7 @@ const message = {
test_duration: '{0}時{1}分{2}秒',
test_duration_tips: '執行時長:{0}時{1}分{2}秒',
},
sync_scenario_no_permission_tips: '沒有查看接口的權限無法執行同步',
sync_scenario_no_permission_tips: '沒有创建接口的權限無法執行同步',
}
}