解决gson异常转义
This commit is contained in:
@@ -113,7 +113,7 @@ public class JMeterUtil {
|
|||||||
// 解析 JSON 数组
|
// 解析 JSON 数组
|
||||||
List<Map<String, String>> headerList = null;
|
List<Map<String, String>> headerList = null;
|
||||||
try {
|
try {
|
||||||
requestHeader = requestHeader.replaceAll(",\\s*\\[\\{\"key\":\"\",\"value\":\"\"\\}]", "");
|
// requestHeader = requestHeader.replaceAll(",\\s*\\[\\{\"key\":\"\",\"value\":\"\"\\}]", "");
|
||||||
headerList = gson.fromJson(requestHeader, type);
|
headerList = gson.fromJson(requestHeader, type);
|
||||||
// 将 List<Map<String, String>> 转换为 Map<String, String>
|
// 将 List<Map<String, String>> 转换为 Map<String, String>
|
||||||
for (Map<String, String> entry : headerList) {
|
for (Map<String, String> entry : headerList) {
|
||||||
@@ -281,8 +281,8 @@ public class JMeterUtil {
|
|||||||
// 将JSON字符串转换为List<Map<String, String>>
|
// 将JSON字符串转换为List<Map<String, String>>
|
||||||
List<Map<String, String>> keyValuePairs = null;
|
List<Map<String, String>> keyValuePairs = null;
|
||||||
try {
|
try {
|
||||||
jsonString = jsonString.replaceAll(", \\[\\{\\}]", "");
|
// jsonString = jsonString.replaceAll(", \\[\\{\\}]", "");
|
||||||
jsonString = jsonString.replaceAll(",\\[\\{\\}]", "");
|
// jsonString = jsonString.replaceAll(",\\[\\{\\}]", "");
|
||||||
keyValuePairs = gson.fromJson(jsonString, listType);
|
keyValuePairs = gson.fromJson(jsonString, listType);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("gson.fromJson发生异常!jsonString:" + jsonString, e);
|
logger.error("gson.fromJson发生异常!jsonString:" + jsonString, e);
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ export default {
|
|||||||
item.childrenList = null;
|
item.childrenList = null;
|
||||||
let cindex = 1;
|
let cindex = 1;
|
||||||
childrenList.forEach((children) => {
|
childrenList.forEach((children) => {
|
||||||
|
children.assertion.pop();
|
||||||
|
children.assignment.pop();
|
||||||
|
children.requestHeader.pop();
|
||||||
|
children.requestParams.pop();
|
||||||
p.push({
|
p.push({
|
||||||
...children,
|
...children,
|
||||||
caseId: this.$route.query.id,
|
caseId: this.$route.query.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user