fix: When you append a string to the workflow context, the value has multiple double quotes.(#307)

This commit is contained in:
读钓 2022-08-31 23:15:04 +08:00 committed by GitHub
parent fb6e57a75c
commit 62d682fbd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,9 @@ public class JsonUtils {
} }
public static String toJSONString(Object obj) { public static String toJSONString(Object obj) {
if (obj instanceof String) {
return (String) obj;
}
try { try {
return objectMapper.writeValueAsString(obj); return objectMapper.writeValueAsString(obj);
}catch (Exception ignore) { }catch (Exception ignore) {
@ -30,6 +33,9 @@ public class JsonUtils {
} }
public static String toJSONStringUnsafe(Object obj) { public static String toJSONStringUnsafe(Object obj) {
if (obj instanceof String) {
return (String) obj;
}
try { try {
return objectMapper.writeValueAsString(obj); return objectMapper.writeValueAsString(obj);
}catch (Exception e) { }catch (Exception e) {