mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix json bug
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.convert.impl;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.IterUtil;
|
||||
import cn.hutool.core.convert.AbstractConverter;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
@@ -124,6 +125,16 @@ public class ArrayConverter extends AbstractConverter<Object> {
|
||||
return convertArrayToArray(value.toString().toCharArray());
|
||||
}
|
||||
|
||||
//issue#2365
|
||||
// 字符串转bytes,首先判断是否为Base64,是则转换,否则按照默认getBytes方法。
|
||||
if(targetComponentType == byte.class){
|
||||
final String str = value.toString();
|
||||
if(Base64.isBase64(str)){
|
||||
return Base64.decode(value.toString());
|
||||
}
|
||||
return str.getBytes();
|
||||
}
|
||||
|
||||
// 单纯字符串情况下按照逗号分隔后劈开
|
||||
final String[] strings = StrUtil.splitToArray(value.toString(), CharUtil.COMMA);
|
||||
return convertArrayToArray(strings);
|
||||
|
@@ -1046,7 +1046,7 @@ public class ImgUtil {
|
||||
|
||||
/**
|
||||
* 旋转图片为指定角度<br>
|
||||
* 来自:http://blog.51cto.com/cping1982/130066
|
||||
* 来自:<a href="http://blog.51cto.com/cping1982/130066">http://blog.51cto.com/cping1982/130066</a>
|
||||
*
|
||||
* @param image 目标图像
|
||||
* @param degree 旋转角度
|
||||
|
Reference in New Issue
Block a user