nnnn
This commit is contained in:
@@ -24,6 +24,16 @@ public enum SensitiveStrategy {
|
||||
*/
|
||||
PHONE(DesensitizedUtil::mobilePhone),
|
||||
|
||||
/**
|
||||
* 手机号脱敏
|
||||
*/
|
||||
AUTH_PHONE(s -> {
|
||||
if(s != null && s.length() == 13){
|
||||
return DesensitizedUtil.mobilePhone(s);
|
||||
}
|
||||
return s;
|
||||
}),
|
||||
|
||||
/**
|
||||
* 地址脱敏
|
||||
*/
|
||||
@@ -46,4 +56,10 @@ public enum SensitiveStrategy {
|
||||
public Function<String, String> desensitizer() {
|
||||
return desensitizer;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = DesensitizedUtil.mobilePhone("opsdsada");
|
||||
System.out.println(s);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user