fix(接口测试): 场景步骤跨工作空间跳转问题
--bug=1026410 --user=宋昌昌 【接口测试】导入的场景里有引用的场景,点击引用的场景ID,跳转的项目不对,并且引用步骤变成了复制 https://www.tapd.cn/55049933/s/1376522
This commit is contained in:
parent
48c6630956
commit
d1096743c7
|
@ -67,7 +67,7 @@ export default {
|
|||
init() {
|
||||
let data = {
|
||||
userId: getCurrentUserId(),
|
||||
workspaceId: (this.$route.params && this.$route.params.workspaceId) || getCurrentWorkspaceId()
|
||||
workspaceId: this.$route.params.workspaceId || getCurrentWorkspaceId()
|
||||
};
|
||||
this.loading = true;
|
||||
getUserProjectList(data)
|
||||
|
@ -76,9 +76,11 @@ export default {
|
|||
this.items = response.data;
|
||||
this.searchArray = response.data;
|
||||
let projectId = getCurrentProjectID();
|
||||
if (this.$route.params && this.$route.params.projectId) {
|
||||
this.change(this.$route.params.projectId);
|
||||
} else if (projectId) {
|
||||
if (projectId) {
|
||||
// 路由跳转的项目ID与当前项目ID不一致时, 切换项目(API跨工作空间的场景)
|
||||
if (this.$route.fullPath.startsWith("/api") && this.$route.params.projectId && this.$route.params.projectId !== projectId && this.$route.params.projectId !== 'all') {
|
||||
this.change(this.$route.params.projectId);
|
||||
}
|
||||
// 保存的 projectId 在当前项目列表是否存在; 切换工作空间后
|
||||
if (this.searchArray.length > 0 && this.searchArray.map(p => p.id).indexOf(projectId) === -1) {
|
||||
this.change(this.items[0].id);
|
||||
|
|
Loading…
Reference in New Issue