赞
踩
1.创建springboot项目,映入pom依赖
- <dependency>
- <groupId>io.gitee.chemors</groupId>
- <artifactId>secure-ext-spring-boot-starter</artifactId>
- <version>1.0.3-RELEASE</version>
- </dependency>
2.application.yml
- sensitive:
- enable: true
3.创建实体类,使用@DesensitizationProp注解,并在SensitiveTypeEnum.脱敏类型
- @Data
- @AllArgsConstructor
- @NoArgsConstructor
- @ToString
- public class User {
-
-
- private Integer uid;
- /*中文名*/
- @DesensitizationProp(SensitiveTypeEnum.CHINESE_NAME)
- private String userName;
-
- /*手机号码*/
- @DesensitizationProp(SensitiveTypeEnum.MOBILE_PHONE)
- private String userMobile;
-
- /*自定义脱敏类型*/
- @DesensitizationProp(value = SensitiveTypeEnum.CUSTOM,preLength = 3,sufLength = 7)
- pri

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。