在1.5.x版本中通過management.security.enabled=false來暴露所有端點
在使用springcloud的時候,如果基於springboot2的版本的配置中心,無法使用SVN的刷新功能(修改配置后不需要重啟服務器),那么需要重新按照新版本的要求進行配置
#yml格式
management:
endpoints:
web:
exposure:
include: refresh
#properties文件格式
management.endpoints.web.exposure.include=*
同時在控制層需要加上相應注解
@RefreshScope // 使用該注解的類,會在接到SpringCloud配置中心配置刷新的時候,自動將新的配置更新到該類對應的字段中。
然后用post請求去訪問http://localhost:8002/refresh
