fix(接口测试): 场景步骤跨工作空间跳转问题

--bug=1026410 --user=宋昌昌 【接口测试】导入的场景里有引用的场景,点击引用的场景ID,跳转的项目不对,并且引用步骤变成了复制 https://www.tapd.cn/55049933/s/1376522
This commit is contained in:
song-cc-rock 2023-05-29 15:08:51 +08:00 committed by fit2-zhao
parent 48c6630956
commit d1096743c7
1 changed files with 6 additions and 4 deletions

View File

@ -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) {
// IDID, (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);