diff --git a/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java b/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java index 5142540..5487958 100644 --- a/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java +++ b/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java @@ -1,5 +1,6 @@ package com.changhu.support.fastjson2.serializer; +import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; import com.alibaba.fastjson2.JSONWriter; import com.alibaba.fastjson2.writer.ObjectWriter; @@ -22,6 +23,8 @@ public class MinioPrefixSerializer implements ObjectWriter { @Override public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) { - jsonWriter.writeString(minioPrefix + object); + if (object instanceof String path && StrUtil.isNotEmpty(path)) { + jsonWriter.writeString(minioPrefix + object); + } } }