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