You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.3 KiB

本模块是一个可被其他业务模块通过 Maven 依赖引入的 JAR 包,不打包为可执行应用(pom 注释明确不做 spring-boot repackage)。启动类 AuthApplication 仅用于本地联调,扫描 com.crm 包并注册 com.crm.**.mapper 的 MapperScan,使业务模块只需配置 scanBasePackages 覆盖 com.crm 即可自动获得认证能力。

模块内部按领域分层:

  • security 层(JwtAuthenticationFilter、TokenService、SecurityExceptionHandlers、DataScopeInterceptor)实现 JWT 校验、异常统一处理与数据范围 SQL 注入;
  • service 层通过 IAuthService / IAuthUserService / ISysRoleService / ISysMenuService / ISysDeptService 等接口暴露认证与 RBAC 能力,impl 中集成第三方登录客户端(DingTalkAuthClient、ThirdPartyAuthClientFactory);
  • domain 层包含 AuthIdentity/AuthUser/SysRole/SysMenu/SysDept 等实体及 DTO/Param;
  • config 层通过 SecurityConfig 装配 Spring Security,PermissionConfig 与 DataInitializer 初始化权限与基础数据。

两个子模块 authentication_core(登录/注销/用户信息)与 user_role_permission(RBAC 基础数据 CRUD)在本模块内通过 service 接口解耦,由同一套 mapper 访问数据库,共享 JwtAuthenticationFilter 与 DataScopeInterceptor 完成统一的鉴权与数据范围控制。