fix(接口测试): 接口首页不同协议的用例跳转

--user=郭雨琦
--bug=1014073
【接口测试】首页-过去7天测试计划失败用例TOP10,非HTTP的接口也会跳到HTTP页面
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014073
This commit is contained in:
guoyuqi 2022-06-15 16:34:04 +08:00 committed by fit2-zhao
parent ee9ddeb3b1
commit 7613166535
2 changed files with 24 additions and 17 deletions

View File

@ -80,26 +80,33 @@ export default {
this.$emit('redirectPage', 'testPlanEdit', null, param); this.$emit('redirectPage', 'testPlanEdit', null, param);
break; break;
case "apiCase": case "apiCase":
this.$get('/api/definition/get/' + param.id, (response) => { this.$get('/api/testcase/findById/' + param.id, (response) => {
let api = response.data; let apiCase = response.data;
if (!api) { if (!apiCase) {
this.$message.error(this.$t('commons.api_case') + this.$t('commons.not_exist')) this.$message.error(this.$t('commons.api_case') + this.$t('commons.not_exist'))
} else { } else {
if (param.protocol === 'dubbo://') { this.$get('/api/definition/get/' + apiCase.apiDefinitionId, (response) => {
param.protocol = 'DUBBO' let api = response.data;
} if (api) {
definitionData = this.$router.resolve({ this.$message.error(this.$t('api_test.home_page.api_details_card.title') + this.$t('commons.not_exist'))
name: 'ApiDefinition', } else {
params: { if (param.protocol === 'dubbo://') {
redirectID: getUUID(), param.protocol = 'DUBBO'
dataType: "api", }
dataSelectRange: 'edit:' + param.id, definitionData = this.$router.resolve({
projectId: getCurrentProjectID(), name: 'ApiDefinition',
type: api.protocol, params: {
workspaceId: getCurrentWorkspaceId(), redirectID: getUUID(),
dataType: "api",
dataSelectRange: 'edit:' + param.id,
projectId: getCurrentProjectID(),
type: api.protocol,
workspaceId: getCurrentWorkspaceId(),
}
});
window.open(definitionData.href, '_blank');
} }
}); });
window.open(definitionData.href, '_blank');
} }
}); });
break; break;

View File

@ -30,7 +30,7 @@
<span v-if="!data.isEdit" class="node-icon"> <span v-if="!data.isEdit" class="node-icon">
<i class="el-icon-folder"/> <i class="el-icon-folder"/>
</span> </span>
<el-tooltip class="item" effect="dark" :content="data.name" placement="top-start" open-delay="1000"> <el-tooltip class="item" effect="dark" :content="data.name" placement="top-start" :open-delay="1000">
<span v-if="!data.isEdit" class="node-title" v-text="data.name"/> <span v-if="!data.isEdit" class="node-title" v-text="data.name"/>
</el-tooltip> </el-tooltip>