SpringBoot SwaggerUi加密
近期发现security
能为swagger-ui加密,下面为实现
首先加入security
jar包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
接着在yml
文件中加入
spring:
security:
basic:
path: /swagger-ui.html
enabled: true
user:
name: admin //账号
password: 123456 //密码
还没有评论,来说两句吧...