springboot 版本2.2.7.release
在build.gradle中设置thymeleaf-extras-springsecurity为 compile(‘org.thymeleaf.extras:thymeleaf-extras-springsecurity5’)
同时在html中设置 xmlns:sec=“http://www.thymeleaf.org/thymeleaf-extras-springsecurity5”
详见https://segmentfault.com/a/1190000021529294