为了实现 Spring Boot 的安全性,我们使用 spring-boot-starter-security 依赖
项,并且必须添加安全配置。它只需要很少的代码。配置类将必须扩展
WebSecurityConfigurerAdapter 并覆盖其方法。