/**
* 获取值
* @param key
* @return
*/
public static Object getParam(String key) {
InputStream is = CredentialHandingUtils.class.getClassLoader().getResourceAsStream("application.yml");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
Properties props = new Properties();
try {
props.load(br);
return props.get(key);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
工具类获取yml的属性值
于 2023-03-13 11:32:38 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)