spring-cloud security引起的安全认证错误
使用时注意两点:一个是defaultZone的地址写法`
security:
basic:
enabled: true
user:
name: pjx
password: 789
server:
port: 8761
eureka:
client:
healthcheck:
enabled: true
register-with-eureka: false
fetch-registry: false
*service-url:
defaultZone: http://pjx:789@localhost:8761/eureka/ #http://name:password@port/eureka`*
另一点需要注意的是只需要在server端引进对应的依赖包即可,在客户端则不需要引进,不然在进行服务调用是会
重复填写用户名以及密码,且造成无法返回数据的后果!