18 lines
382 B
Markdown
18 lines
382 B
Markdown
## spring-security
|
||
1. 首先在pom文件中增加依赖
|
||
```xml
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-security</artifactId>
|
||
</dependency>
|
||
```
|
||
2. 可选项,在application.yml文件中配置默认的用户名密码
|
||
```yaml
|
||
spring:
|
||
security:
|
||
user:
|
||
name: xiaoyan159
|
||
password: xiaoyan159062
|
||
roles: admin
|
||
```
|