fix(接口测试): 接口定义跨空间跳转失败

--bug=1011493
--user=郭雨琦
【接口测试】跨工作空间引用接口定义,跳转报错
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001011493
This commit is contained in:
guoyuqi 2022-03-21 17:52:16 +08:00 committed by xiaomeinvG
parent af4b298296
commit c8d9429e02
2 changed files with 14 additions and 6 deletions

View File

@ -418,16 +418,24 @@ export default {
},
},
created() {
let workspaceId = this.$route.params.workspaceId;
if (workspaceId) {
sessionStorage.setItem(WORKSPACE_ID, workspaceId);
}else {
if(this.$route.query.workspaceId){
sessionStorage.setItem(WORKSPACE_ID, this.$route.query.workspaceId);
workspaceId = this.$route.query.workspaceId;
sessionStorage.setItem(WORKSPACE_ID, workspaceId);
}
}
let projectId = this.$route.params.projectId;
if (projectId) {
sessionStorage.setItem(PROJECT_ID, projectId);
}
}else {
if (this.$route.query.projectId) {
projectId = this.$route.query.projectId;
sessionStorage.setItem(PROJECT_ID, this.$route.query.projectId);
}
}
this.getEnv();
//
if (this.$route.query.caseId) {

View File

@ -35,7 +35,7 @@ export default {
},
{
path: "definition/:redirectID?/:dataType?/:dataSelectRange?/:projectId?/:type?",
path: "definition/:redirectID?/:dataType?/:dataSelectRange?/:projectId?/:type?/:workspaceId?",
name: "ApiDefinition",
component: () => import('@/business/components/api/definition/ApiDefinition'),
},