fix(接口测试): 解决执行接口定义console报错

--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001017109
This commit is contained in:
guoyuqi 2022-09-21 16:34:43 +08:00 committed by xiaomeinvG
parent 50ddc22355
commit 4be0e60728
1 changed files with 7 additions and 1 deletions

View File

@ -785,7 +785,13 @@ export default {
this.$emit('copyApi', obj); this.$emit('copyApi', obj);
}, },
runApi(row) { runApi(row) {
let request = row ? JSON.parse(row.request) : {}; let request;
if (typeof (row.request) === 'string') {
request = row ? JSON.parse(row.request) : {};
} else {
request = row ? row.request : {};
}
if (row.tags instanceof Array) { if (row.tags instanceof Array) {
row.tags = JSON.stringify(row.tags); row.tags = JSON.stringify(row.tags);
} }