fix(接口测试): 修复接口定义body参数使用内置函数提示参数报错的缺陷

https://github.com/metersphere/metersphere/issues/21106
https://github.com/metersphere/metersphere/issues/21104
This commit is contained in:
wxg0103 2023-01-05 14:00:28 +08:00 committed by wxg0103
parent cc5fd7f7d7
commit 8867e78e5e
2 changed files with 6 additions and 2 deletions

View File

@ -243,7 +243,11 @@ public class JSONUtil {
public static String parser(String content) {
try {
Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().create();
Gson gson = new GsonBuilder()
.setPrettyPrinting()
.disableHtmlEscaping()
.serializeNulls()
.create();
return gson.toJson(JsonParser.parseString(content).getAsJsonObject());
} catch (Exception e) {
return content;

View File

@ -275,7 +275,7 @@
</div>
</el-form>
<p class="tip">{{ $t('schema.preview') }}</p>
<pre style="width: 100%">{{ completeNodeValue }}</pre>
<pre style="width: 100%; white-space: pre-wrap;">{{ completeNodeValue }}</pre>
<span slot="footer" class="dialog-footer">
<ms-dialog-footer @cancel="modalVisible = false" @confirm="handleOk" />