<?xml version="1.0" encoding="UTF-8"?>
<!-- 引入Apollo client配置 -->
<apollo:config namespaces="aaaa.properties,bbbb.properties" order="1" />
引入apollo配置后
/**
-
用于为密文解密
*/
@Component
public class DecryptPropertySourcesPlaceholderConfigurer extends PropertySourcesPlaceholderConfigurer {
@Override
protected void doProcessProperties(ConfigurableListableBeanFactory beanFactoryToProcess, StringValueResolver valueResolver) {
System.out.println();
super.doProcessProperties(beanFactoryToProcess, s -> {
String value = valueResolver.resolveStringValue(s);//value就是apollo里面的值,对其修改就会生效 return value; });
}
}