- 在 SysUser 实体类中为手机号码字段添加 @Sensitive 注解 - 新增 @NoSensitive 注解和相关切面、拦截器,用于 “关闭” 数据脱敏 - 在用户信息相关接口中添加 @NoSensitive 注解,以 “关闭” 数据脱敏 - 新增 WebMvcConfig 配置类,注册 NoSensitiveInterceptor 拦截器pull/421/head
parent
e549210ad6
commit
2622d9147e
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Description “关闭” 数据脱敏
|
||||
* @Author AhYi
|
||||
* @Date 2025-07-07 10:23
|
||||
*/
|
||||
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface NoSensitive {
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.system;
|
||||
|
||||
import com.ruoyi.common.security.interceptor.NoSensitiveInterceptor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* @Description WebMvcConfig
|
||||
* @Author AhYi
|
||||
* @Date 2025-07-07 10:46
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new NoSensitiveInterceptor())
|
||||
.addPathPatterns("/**")
|
||||
.order(-1);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue