1.Spring Security
基本入门
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>security.user.name = admin
security.user.password = 123456原理


资料
Last updated
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>security.user.name = admin
security.user.password = 123456

Last updated
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); // 获取当前登录用户的信息
System.out.println(authentication);
if(authentication != null) {
System.out.println(authentication.getPrincipal()); // 当前认证后的信息
}