整合Springsecurity时需要获取登录的用户名使用sec:authentication="name"不能取到值
springboot版本:2.1.4
我的问题是thymeleaf-extras-springsecurity版本用的是4,改使用5没有问题
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
</dependency>