|
@@ -54,20 +54,20 @@ public class AvatarUtil {
|
|
|
if(color==null){
|
|
if(color==null){
|
|
|
color=defaultColor;
|
|
color=defaultColor;
|
|
|
}
|
|
}
|
|
|
- String key=new String(StrUtil.trim(name));;
|
|
|
|
|
|
|
+ String key=new String(name+":"+color.getRGB());
|
|
|
String result = avatarMap.get(key);
|
|
String result = avatarMap.get(key);
|
|
|
if(StrUtil.isNotBlank(result)){
|
|
if(StrUtil.isNotBlank(result)){
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
- if(StrUtil.isBlank(key)){
|
|
|
|
|
- key="匿名";
|
|
|
|
|
|
|
+ if(StrUtil.isBlank(name)){
|
|
|
|
|
+ name="匿名";
|
|
|
}
|
|
}
|
|
|
int width = 100;
|
|
int width = 100;
|
|
|
int height = 100;
|
|
int height = 100;
|
|
|
// int nameLen = name.length();
|
|
// int nameLen = name.length();
|
|
|
|
|
|
|
|
|
|
|
|
|
- String nameWritten=StrUtil.sub(key,0,1);
|
|
|
|
|
|
|
+ String nameWritten=StrUtil.sub(name,0,1);
|
|
|
// // 如果用户输入的姓名少于等于2个字符,不用截取
|
|
// // 如果用户输入的姓名少于等于2个字符,不用截取
|
|
|
// if (nameLen == 1) {
|
|
// if (nameLen == 1) {
|
|
|
// nameWritten = name;
|
|
// nameWritten = name;
|