解决办法【设置端点访问 】:spring
1, 关闭验证app
management.security.enabled=false
2,开启HTTP basic认证 spring-boot
- 添加依赖spa
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>
- application.properties 添加用户名和密码code
security.user.name=admin
security.user.password=123456
management.security.enabled=true
management.security.role=ADMIN
访问URL http://localhost:8080/env 后,就看到须要输入用户名和密码了blog