fix(接口定义): tags处理

--user=郭雨琦 tags处理
This commit is contained in:
guoyuqi 2022-01-20 11:14:47 +08:00 committed by 刘瑞斌
parent 18d5f47c4b
commit 2105d16cba
2 changed files with 6 additions and 2 deletions

View File

@ -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: {

View File

@ -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);
}
}