diff --git a/designer-base/src/main/java/com/fr/start/common/DesignerStartupConfig.java b/designer-base/src/main/java/com/fr/start/common/DesignerStartupConfig.java index d8caf035d3..6afef4f3b6 100644 --- a/designer-base/src/main/java/com/fr/start/common/DesignerStartupConfig.java +++ b/designer-base/src/main/java/com/fr/start/common/DesignerStartupConfig.java @@ -12,6 +12,11 @@ public class DesignerStartupConfig implements XMLable { private static final DesignerStartupConfig INSTANCE = new DesignerStartupConfig(); + /** + * 加上版本,不然回滚到 1107 会有兼容问题 + */ + private static final String TAG_ENABLED = "isEnabled1108"; + public static DesignerStartupConfig getInstance() { return INSTANCE; @@ -40,14 +45,14 @@ public class DesignerStartupConfig implements XMLable { @Override public void readXML(XMLableReader reader) { if (reader.isAttr()) { - this.setEnabled(reader.getAttrAsBoolean("isEnabled", true)); + this.setEnabled(reader.getAttrAsBoolean(TAG_ENABLED, true)); } } @Override public void writeXML(XMLPrintWriter writer) { writer.startTAG(XML_TAG); - writer.attr("isEnabled", this.isEnabled()); + writer.attr(TAG_ENABLED, this.isEnabled()); writer.end(); } diff --git a/designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java b/designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java index 9c8b986341..b42a6c65bd 100644 --- a/designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java +++ b/designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java @@ -117,7 +117,7 @@ public class DesignerStartupContext { /** * 展示启动页 - * 1. 判断当前的工作目录数量 + * 1. 判断当前的工作目录数量为空或者为1 * 2. 判断是否是 demo、还是打开目标文件 * 3. 功能是否开启 * @@ -125,10 +125,20 @@ public class DesignerStartupContext { */ public boolean isShowStartupPage() { + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + return !startupArgs.isDemo() && DesignerStartupUtil.convertArgs2FILE(startupArgs.get()) == null + // 见该 field 的注释 + && enabled + && isWorkspaceValid() + && envManager.isStartupPageEnabled(); + } + + private boolean isWorkspaceValid() { + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); Iterator envNameIterator = envManager.getEnvNameIterator(); ArrayList envs = Lists.newArrayList(envNameIterator); - return !startupArgs.isDemo() && DesignerStartupUtil.convertArgs2FILE(startupArgs.get()) == null && !envs.isEmpty() && (envs.size() != 1) && envManager.isStartupPageEnabled() && enabled; + return !envs.isEmpty() && (envs.size() != 1); } /* 预热相关 */