Commit b42d9947 by 阳浪

MinioTools优化

parent dba01cd2
......@@ -10,7 +10,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import sun.misc.BASE64Encoder;
import cn.hutool.core.codec.Base64Encoder;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
......@@ -173,10 +173,8 @@ public class MinioTools {
output.write(buff, 0, n);
}
b = output.toByteArray();
// 对字节数组Base64编码
BASE64Encoder encoder = new BASE64Encoder();
// 返回 Base64 编码过的字节数组字符串
return encoder.encode(b);
return Base64Encoder.encode(b);
} catch (Exception e) {
logger.error("获取文件失败", JSONObject.toJSONString(e));
throw new BizException(ReturnCode.BIZ_FAIL.getCode(),"获取文件失败");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment