Browse Source

修改配置项隐藏规则

luoshi 2 năm trước cách đây
mục cha
commit
59e84b1c4b

+ 4 - 1
src/main/java/com/qmth/ops/api/controller/admin/ConfigController.java

@@ -93,7 +93,10 @@ public class ConfigController {
         if (!adminSession.getUser().hasRole(env.getType().getRole())) {
             for (ConfigItem item : list) {
                 if (item.getKey().contains("secret") || item.getKey().contains("password")) {
-                    item.setValue("***");
+                    //直接引用其他变量时不隐藏
+                    if (!(item.getValue().startsWith("${") && item.getValue().endsWith("}"))) {
+                        item.setValue("***");
+                    }
                 }
             }
         }