mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
fix: When you append a string to the workflow context, the value has multiple double quotes.(#307)
This commit is contained in:
parent
fb6e57a75c
commit
62d682fbd5
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user