|
|
@@ -218,7 +218,20 @@ public class DynamicProperties {
|
|
|
if (ObjectUtils.isEmpty(value)) {
|
|
|
throw new IllegalArgumentException("配置项的值为空:" + expression + "=" + value);
|
|
|
}
|
|
|
- properties.setProperty(expression, value.toString());
|
|
|
+ // List 直接 toString,结果中会带 '[]'
|
|
|
+ if (value instanceof List) {
|
|
|
+ List list = (List) value;
|
|
|
+ StringBuilder builder = new StringBuilder();
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ if (i != 0) {
|
|
|
+ builder.append(", ");
|
|
|
+ }
|
|
|
+ builder.append(list.get(i));
|
|
|
+ }
|
|
|
+ properties.setProperty(expression, builder.toString());
|
|
|
+ } else {
|
|
|
+ properties.setProperty(expression, value.toString());
|
|
|
+ }
|
|
|
}
|
|
|
properties.store(new FileOutputStream(new File(PROPERTY_FILE_NAME)), "report properties");
|
|
|
} catch (IOException e) {
|