From 2105d16cba17e16752725c902f489f5fc764e491 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 20 Jan 2022 11:14:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20ta?= =?UTF-8?q?gs=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 tags处理 --- .../components/api/automation/scenario/MsInputTag.vue | 6 +++++- .../api/definition/components/EditCompleteContainer.vue | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue index 1838254353..058e525714 100644 --- a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue +++ b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue @@ -71,7 +71,11 @@ export default { this.currentScenario[this.prop] = this.innerTags; }, 'currentScenario.tags'() { - this.innerTags = this.currentScenario.tags + if(Object.prototype.toString.call(this.currentScenario.tags)==="[object String]"){ + this.innerTags = JSON.parse(this.currentScenario.tags); + }else{ + this.innerTags = this.currentScenario.tags + } }, }, methods: { diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue index 713e39a8c3..23e7d6d5c2 100644 --- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue +++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue @@ -252,7 +252,7 @@ export default { saveApi(data) { this.$emit("saveApi", data); if (data != null && data.tags != 'null' && data.tags != undefined) { - if (Object.prototype.toString.call(data.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') { + if (Object.prototype.toString.call(data.tags)==="[object String]") { data.tags = JSON.parse(data.tags); } }