From 3137f71571d4c9f58ffe2be3d8fb6a08a6ee2cd1 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Tue, 9 Nov 2021 10:15:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62133=20mac=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=8C=85=E8=B5=B7=E4=B8=8D=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/DesignerEnvManager.java | 8 ++++++++ .../com/fr/design/login/DesignerLoginHelper.java | 2 +- .../login/config/DesignerLoginConfigManager.java | 14 ++++++++++++++ .../design/login/guide/DesignerGuideHelper.java | 16 +++++++++++----- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 9c23dcc51a..b8d63ca7a7 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -867,6 +867,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { designerLoginConfigManager.setPluginRemindOnFirstLaunch(pluginRemindOnFirstLaunch); } + public boolean isUseOldVersionLogin() { + return designerLoginConfigManager.isUseOldVersionLogin(); + } + + public void setUseOldVersionLogin(boolean useOldVersionLogin) { + designerLoginConfigManager.setUseOldVersionLogin(useOldVersionLogin); + } + /** * 内置服务器是否使用时启动 * diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java index 2d2dd935d1..8976a07345 100644 --- a/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java @@ -47,7 +47,7 @@ public class DesignerLoginHelper { } public static void showLoginDialog(DesignerLoginSource source, Map params, Window window) { - if (!SupportOSImpl.DESIGNER_LOGIN.support()) { + if (!SupportOSImpl.DESIGNER_LOGIN.support() || DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) { WebViewDlgHelper.createLoginDialog(window); return; } diff --git a/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java index a0ab68109d..b0fb0e292a 100644 --- a/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java @@ -70,6 +70,10 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { * 插件管理第一次启动时的提醒 */ private boolean pluginRemindOnFirstLaunch = true; + /** + * 使用旧版登录 + */ + private boolean useOldVersionLogin = false; private DesignerLoginConfigManager() { @@ -98,6 +102,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { this.setLastLoginAccount(reader.getAttrAsString("lastLoginAccount", StringUtils.EMPTY)); this.setLoginRemindBeforeJumpBBS(reader.getAttrAsBoolean("loginRemindBeforeJumpBBS", true)); this.setPluginRemindOnFirstLaunch(reader.getAttrAsBoolean("pluginRemindOnFirstLaunch", true)); + this.setUseOldVersionLogin(reader.getAttrAsBoolean("useOldVersionLogin", false)); } } @@ -117,6 +122,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { writer.attr("lastLoginAccount", lastLoginAccount); writer.attr("loginRemindBeforeJumpBBS", loginRemindBeforeJumpBBS); writer.attr("pluginRemindOnFirstLaunch", pluginRemindOnFirstLaunch); + writer.attr("useOldVersionLogin", useOldVersionLogin); writer.end(); } @@ -223,4 +229,12 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) { this.pluginRemindOnFirstLaunch = pluginRemindOnFirstLaunch; } + + public boolean isUseOldVersionLogin() { + return useOldVersionLogin; + } + + public void setUseOldVersionLogin(boolean useOldVersionLogin) { + this.useOldVersionLogin = useOldVersionLogin; + } } diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java index b3513bb6da..3e4c0dae51 100644 --- a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java @@ -8,9 +8,7 @@ import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.update.push.DesignerPushUpdateManager; -import com.fr.general.CloudCenter; -import com.fr.general.CloudCenterConfig; -import com.fr.general.http.HttpToolbox; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.WindowConstants; @@ -39,7 +37,11 @@ public class DesignerGuideHelper { public static void prepareShowGuideDialog() { // 如果存在更新升级的弹窗,则不显示引导页面 - if (!DesignerLoginUtils.isOnline() || !SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv() || DesignerPushUpdateManager.getInstance().isShouldPopUp()) { + if (!DesignerLoginUtils.isOnline() + || !SupportOSImpl.DESIGNER_LOGIN.support() + || !FRContext.isChineseEnv() + || DesignerPushUpdateManager.getInstance().isShouldPopUp() + || DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) { return; } if (isActivatedForOneWeek()) { @@ -52,7 +54,11 @@ public class DesignerGuideHelper { DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { @Override public void designerOpened() { - showGuideDialog(); + try { + showGuideDialog(); + } catch (Throwable t) { + FineLoggerFactory.getLogger().warn(t.getMessage(), t); + } } }); }