<dependencies>
<!-- 实现对 Spring MVC 的自动化配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- 实现对 Spring Security 的自动化配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>
Spring Security 配置项
*spring:
–Spring Security 配置项,对应 SecurityProperties 配置类
- security:
–配置默认的 InMemoryUserDetailsManager 的用户账号与密码。 - user:
- name: user # 账号
- password: user # 密码
- roles: ADMIN # 拥有角色