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

--bug=1019677 --user=刘瑞斌 【性能测试】只有性能测试查看权限,同步场景按钮可以点,点了会报错 https://www.tapd.cn/55049933/s/1302474
This commit is contained in:
CaptainB 2022-11-23 12:54:27 +08:00 committed by 刘瑞斌
parent 0b6a82dd3e
commit 321f793310
5 changed files with 11 additions and 5 deletions

View File

@ -89,7 +89,6 @@ export default {
if (res && res.code === 'ECONNABORTED') { if (res && res.code === 'ECONNABORTED') {
return; return;
} }
clearSessionStorage()
reject(res) reject(res)
}) })
}); });

View File

@ -416,6 +416,10 @@ export default {
return formData; return formData;
}, },
syncScenario() { syncScenario() {
if (!hasPermission('PROJECT_API_SCENARIO:READ')) {
this.$warning(this.$t('performance_test.sync_scenario_no_permission_tips'));
return;
}
let param = { let param = {
id: this.test.id, id: this.test.id,
scenarioId: this.test.scenarioId scenarioId: this.test.scenarioId
@ -423,7 +427,7 @@ export default {
syncScenario(param) syncScenario(param)
.then(() => { .then(() => {
this.getTest(this.$route.params.testId); this.getTest(this.$route.params.testId);
this.$success('更新成功'); this.$success('commons.save_success');
}); });
}, },
cancel() { cancel() {

View File

@ -7,7 +7,8 @@ const message = {
report: { report: {
test_duration: '{0} hours {1} minutes {2} seconds', test_duration: '{0} hours {1} minutes {2} seconds',
test_duration_tips: 'Execution Time{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',
} }
} }
export default { export default {

View File

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

View File

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