在刷新配置中心的时候,如:http://localhost:8030/bus/refresh
会遇到一下错误:
{
"timestamp": 1533892993040,
"status": 401,
"error": "Unauthorized",
"message": "Full authentication is required to access this resource.",
"path": "/bus/refresh"
}
提示没有权限,这个是因为 spring-boot-starter-actuator 需要验证,因此只要验证即可,如下:
在peroperites里面要加入=false 来保证调用 /bus/refresh的时候不需要验证。
或者 yml文件中添加:
management:
security:
enabled: false #是否开启actuator安全认证
再次post访问刷新即可正常!