pom.xml
引入 spring-cloud-starter-security
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-security</artifactId>
</dependency>
application.yml
配置 name & password
server:
port: 7901
eureka:
instance:
hostname: eureka-7901
client