一、为EurekaServer增加安全访问
EurekaServer中:pom.xml
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency>
EurekaServer中:application.properties
#eureka 提供服务发现的地址eureka.client.service-url.defaultZone=http://zhangfei:777@localhost:8761/eureka#eureka.client.service-url.defaultZone=http://localhost:8761/eureka# 安全模块security.basic.enabled=truesecurity.user.name=zhangfeisecurity.user.password=777
微服务中: application.properties
eureka.client.serviceUrl.defaultZone=http://zhangfei:777@localhost:8761/eureka
