提交 c6944b10 编写于 作者: N nzomkxia

convert param type to string when necessary #328

上级 ee3f5e42
...@@ -81,13 +81,15 @@ ...@@ -81,13 +81,15 @@
name: null, name: null,
signature: this.$route.query['method'], signature: this.$route.query['method'],
parameterTypes: [], parameterTypes: [],
json: [] json: [],
jsonTypes: []
}, },
result: null result: null
} }
}, },
methods: { methods: {
executeMethod () { executeMethod () {
this.convertType(this.method.json, this.method.jsonTypes)
let serviceTestDTO = { let serviceTestDTO = {
service: this.service, service: this.service,
method: this.method.name, method: this.method.name,
...@@ -105,6 +107,14 @@ ...@@ -105,6 +107,14 @@
this.success = false this.success = false
this.result = error.response.data 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 () { mounted () {
...@@ -125,6 +135,7 @@ ...@@ -125,6 +135,7 @@
} }
}).then(response => { }).then(response => {
this.method.json = response.data.parameterTypes 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.
先完成此消息的编辑!
想要评论请 注册