mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 03:58:33 +08:00
fix(接口测试): 修复接口case请求体json格式打开JSON-SCHEMA后浏览器崩溃
This commit is contained in:
parent
afb8f55fba
commit
db77298ff8
@ -106,7 +106,6 @@ import BatchAddParameter from '../basis/BatchAddParameter';
|
||||
import Convert from '@/business/commons/json-schema/convert/convert';
|
||||
import { getApiParamsConfigFields } from 'metersphere-frontend/src/utils/custom_field';
|
||||
import ApiParamsConfig from '@/business/definition/components/request/components/ApiParamsConfig';
|
||||
import { jsonParse } from '@/business/commons/json-schema/convert/jsonParse'
|
||||
|
||||
export default {
|
||||
name: 'MsApiBody',
|
||||
@ -282,11 +281,9 @@ export default {
|
||||
if (this.body.format === 'JSON-SCHEMA') {
|
||||
if (this.body.raw) {
|
||||
try {
|
||||
const isJson = JSON.parse(this.body.raw);
|
||||
if(isJson) {
|
||||
const jsonObj = jsonParse(this.body.raw)
|
||||
let JSONBig = require('json-bigint')({ storeAsString: true });
|
||||
const jsonObj = JSONBig.parse(this.body.raw)
|
||||
this.body.jsonSchema = MsConvert.format(jsonObj);
|
||||
}
|
||||
} catch (e) {
|
||||
this.body.format = 'JSON';
|
||||
this.$message.error(this.$t('api_definition.body.json_format_error'));
|
||||
|
Loading…
Reference in New Issue
Block a user