diff --git a/src/org/redkale/service/RetResult.java b/src/org/redkale/service/RetResult.java index 62acf2d6f..c5d6695bd 100644 --- a/src/org/redkale/service/RetResult.java +++ b/src/org/redkale/service/RetResult.java @@ -124,7 +124,8 @@ public class RetResult { */ public RetResult attach(String key, Object value) { if (this.attach == null) this.attach = new HashMap<>(); - this.attach.put(key, value == null ? null : String.valueOf(value)); + boolean canstr = value instanceof CharSequence || value.getClass().isPrimitive(); + this.attach.put(key, value == null ? null : (canstr ? String.valueOf(value) : JsonConvert.root().convertTo(value))); return this; }