update 标准化活动 集团参与情况的邮箱和手机号加密回显
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -233,4 +234,20 @@ public class PasswordUtil {
|
||||
return (byte) "0123456789ABCDEF".indexOf(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回显时加密邮箱
|
||||
* @param email
|
||||
* @return
|
||||
*/
|
||||
public static String desensitizedEmail(String email) {
|
||||
if (StrUtil.isBlank(email)) {
|
||||
return StrUtil.EMPTY;
|
||||
}
|
||||
int index = StrUtil.indexOf(email, '@');
|
||||
if (index <= 4) {
|
||||
return StrUtil.hide(email, 0, index);
|
||||
}
|
||||
return StrUtil.hide(email, index - 4, index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user