配置正确
控制台更改也有读取到
需要插入 @RefreshScope
@RestController
@RequestMapping("/test")
@RefreshScope
public class TestController {
@Value("${user.name:}")
private String name;
@GetMapping("config")
public String testConfig(){
return name;
}
}