提交 c6944b10 编写于 作者: N nzomkxia

convert param type to string when necessary #328

上级 ee3f5e42
......@@ -81,13 +81,15 @@
name: null,
signature: this.$route.query['method'],
parameterTypes: [],
json: []
json: [],
jsonTypes: []
},
result: null
}
},
methods: {
executeMethod () {
this.convertType(this.method.json, this.method.jsonTypes)
let serviceTestDTO = {
service: this.service,
method: this.method.name,
......@@ -105,6 +107,14 @@
this.success = false
this.result = error.response.data
})
},
convertType (params, types) {
for (let i = 0; i < params.length; i++) {
if (typeof types[i] === 'string' && typeof params[i] !== 'string') {
params[i] = String(params[i])
}
}
}
},
mounted () {
......@@ -125,6 +135,7 @@
}
}).then(response => {
this.method.json = response.data.parameterTypes
this.method.jsonTypes = response.data.parameterTypes
})
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册