diff --git a/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java b/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java index 80d6462fab..6fc3c817b4 100644 --- a/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java +++ b/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java @@ -1,22 +1,14 @@ package com.fr.design.login; +import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; -import com.fr.general.log.MessageFormatter; -import com.fr.json.JSONObject; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; -import com.fr.third.org.bouncycastle.util.encoders.Hex; import java.awt.event.ActionEvent; -import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; -import javax.crypto.Cipher; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; /** * @author Lanlan @@ -25,30 +17,19 @@ import javax.crypto.spec.SecretKeySpec; */ public abstract class AbstractDesignerSSO extends UpdateAction { - private static final String PRODUCT_FINEREPORT = "product-finereport"; - - private static final String KEY = "i7hP48WAcuTrmxfN"; - @Override public void actionPerformed(ActionEvent event) { String url = getJumpUrl(); - if (!SupportOSImpl.DESIGNER_LOGIN.support()) { - BrowseUtils.browser(url); - return; - } DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); int uid = manager.getDesignerLoginUid(); if (uid > 0) { - String ssoUrl = CloudCenter.getInstance().acquireUrlByKind("designer.sso.api", "https://id.fanruan.com/api/app/?code={}&referrer={}"); - try { - String code = generateLoginCode(); - MessageFormatter.FormattingTuple tuple = MessageFormatter.arrayFormat(ssoUrl, new String[]{code, url}); - BrowseUtils.browser(tuple.getMessage()); - } catch (Exception e) { + String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(url); + BrowseUtils.browser(ssoUrl); + } else { + if (!SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv()) { BrowseUtils.browser(url); - FineLoggerFactory.getLogger().error(e.getMessage(), e); + return; } - } else { boolean loginRemindBeforeJumpBBS = manager.isLoginRemindBeforeJumpBBS(); if (loginRemindBeforeJumpBBS) { Map params = new HashMap<>(); @@ -61,32 +42,5 @@ public abstract class AbstractDesignerSSO extends UpdateAction { } } - private String generateLoginCode() throws Exception { - DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); - JSONObject jo = JSONObject.create(); - jo.put("uid", manager.getDesignerLoginUid()); - jo.put("username", manager.getDesignerLoginUsername()); - jo.put("source", PRODUCT_FINEREPORT); - byte[] iv = randomIv(); - return new String(Hex.encode(iv)) + encrypt(jo.toString(), KEY.getBytes(), iv); - } - - private static byte[] randomIv() { - byte[] salt = new byte[16]; - SecureRandom secureRandom = new SecureRandom(); - secureRandom.setSeed(System.currentTimeMillis()); - secureRandom.nextBytes(salt); - return salt; - } - - public static String encrypt(String content, byte[] key, byte[] iv) throws Exception { - SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES"); - Cipher cipher = Cipher.getInstance("AES/CTR/PKCS5Padding"); - IvParameterSpec ivParameterSpec = new IvParameterSpec(iv); - cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); - byte[] resultBytes = cipher.doFinal(content.getBytes()); - return new String(Hex.encode(resultBytes)); - } - public abstract String getJumpUrl(); } 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 f6112e7147..8adebba4f1 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 @@ -1,10 +1,12 @@ package com.fr.design.login.guide; +import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.UIDialog; import com.fr.design.event.DesignerOpenedListener; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.update.push.DesignerPushUpdateManager; import com.fr.stable.StringUtils; import javax.swing.WindowConstants; @@ -32,7 +34,8 @@ public class DesignerGuideHelper { } public static void prepareShowGuideDialog() { - if (!SupportOSImpl.DESIGNER_LOGIN.support()) { + // 如果存在更新升级的弹窗,则不显示引导页面 + if (!SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv() || DesignerPushUpdateManager.getInstance().isShouldPopUp()) { return; } if (isActivatedForOneWeek()) { diff --git a/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java b/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java index 0e1815c25b..5dd49a00bb 100644 --- a/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java +++ b/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java @@ -2,9 +2,18 @@ package com.fr.design.login.utils; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; +import com.fr.general.log.MessageFormatter; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.third.org.bouncycastle.util.encoders.Hex; +import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; /** * @author Lanlan @@ -13,6 +22,10 @@ import java.util.Map; */ public class DesignerLoginUtils { + private static final String PRODUCT_FINEREPORT = "product-finereport"; + + private static final String KEY = "i7hP48WAcuTrmxfN"; + public static Map renderMap() { Map map4Tpl = new HashMap<>(); map4Tpl.put("language", GeneralContext.getLocale().toString()); @@ -32,4 +45,43 @@ public class DesignerLoginUtils { } } } + + public static String generateDesignerSSOUrl(String referrer) { + String ssoTemplate = CloudCenter.getInstance().acquireUrlByKind("designer.sso.api", "https://id.fanruan.com/api/app/?code={}&referrer={}"); + try { + String code = generateLoginCode(); + MessageFormatter.FormattingTuple tuple = MessageFormatter.arrayFormat(ssoTemplate, new String[]{code, referrer}); + return tuple.getMessage(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return referrer; + } + + private static String generateLoginCode() throws Exception { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + JSONObject jo = JSONObject.create(); + jo.put("uid", manager.getDesignerLoginUid()); + jo.put("username", manager.getDesignerLoginUsername()); + jo.put("source", PRODUCT_FINEREPORT); + byte[] iv = randomIv(); + return new String(Hex.encode(iv)) + encrypt(jo.toString(), KEY.getBytes(), iv); + } + + private static byte[] randomIv() { + byte[] salt = new byte[16]; + SecureRandom secureRandom = new SecureRandom(); + secureRandom.setSeed(System.currentTimeMillis()); + secureRandom.nextBytes(salt); + return salt; + } + + private static String encrypt(String content, byte[] key, byte[] iv) throws Exception { + SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES"); + Cipher cipher = Cipher.getInstance("AES/CTR/PKCS5Padding"); + IvParameterSpec ivParameterSpec = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); + byte[] resultBytes = cipher.doFinal(content.getBytes()); + return new String(Hex.encode(resultBytes)); + } } diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java index 7440895a8b..91f9bf3dc7 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java @@ -30,6 +30,7 @@ import com.fr.event.Listener; import com.fr.log.FineLoggerFactory; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -51,7 +52,7 @@ public class ContentReplacerCenter { } private List contentChangeList = new ArrayList<>(); - private List items = new ArrayList<>(); + private Map itemsMap = new HashMap<>(); private ContentReplacerCenter() { @@ -61,21 +62,21 @@ public class ContentReplacerCenter { if (param.getChangeMap().isEmpty()) { return; } - items.add(param); + itemsMap.put(param.getChangeItem(), param); } }); EventDispatcher.listen(TableDataModifyEvent.INSTANCE, new Listener() { @Override public void on(Event event, ContentChangeItem param) { - items.add(param); + itemsMap.put(param.getChangeItem(), param); long start = System.currentTimeMillis(); ContentObjectManager.getInstance().searchObject(param.getObject()); FineLoggerFactory.getLogger().debug("search object spend {} ms", (System.currentTimeMillis() - start)); FineLoggerFactory.getLogger().debug("search result: {}", ContentObjectManager.getInstance().getObjectMap() == null ? null : ContentObjectManager.getInstance().getObjectMap().keySet()); - List itemsCopy = new ArrayList<>(items); - items.clear(); + List itemsCopy = new ArrayList<>(itemsMap.values()); + itemsMap.clear(); onRename(itemsCopy, contentChangeList); } }); diff --git a/designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java b/designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java index b4a1b49071..304cae1ba1 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java @@ -5,6 +5,7 @@ import com.fr.decision.update.info.UpdateCallBack; import com.fr.decision.update.info.UpdateProgressCallBack; import com.fr.design.i18n.Toolkit; import com.fr.design.versioncheck.VersionCheckUtils; +import com.fr.env.SyncFailedPluginsDialog; import com.fr.json.JSONArray; import com.fr.log.FineLoggerFactory; import java.util.concurrent.ExecutionException; @@ -14,11 +15,12 @@ import javax.swing.SwingWorker; public abstract class SyncFileProcess extends SwingWorker { private String buildNo; private JProgressBar bar; - private JSONArray syncFailedPlugins; + private SyncFailedPluginsDialog syncFailedPluginsDialog; - public SyncFileProcess(JProgressBar bar, String buildNo) { + public SyncFileProcess(JProgressBar bar, String buildNo, SyncFailedPluginsDialog syncFailedPluginsDialog) { this.bar = bar; this.buildNo = buildNo; + this.syncFailedPluginsDialog = syncFailedPluginsDialog; } @Override @@ -26,8 +28,19 @@ public abstract class SyncFileProcess extends SwingWorker { UpdateCallBack callBack = new UpdateProgressCallBack(bar); bar.setValue(0); bar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); - syncFailedPlugins = VersionCheckUtils.syncPlugins(VersionCheckUtils.checkLocalAndRemotePlugin()); - return SyncExecutor.getInstance().execute(callBack, buildNo); + JSONArray syncFailedPlugins = VersionCheckUtils.syncPlugins(VersionCheckUtils.checkLocalAndRemotePlugin()); + if (syncFailedPlugins.size() > 0) { + syncFailedPluginsDialog.showSyncFailedPluginsInfo(syncFailedPlugins); + } + RecoverForDesigner recoverForDesigner = new RecoverForDesigner(); + if (!recoverForDesigner.backup()) { + return false; + } + boolean result = SyncExecutor.getInstance().execute(callBack, buildNo); + if (!result) { + recoverForDesigner.recover(); + } + return result; } @Override @@ -48,9 +61,6 @@ public abstract class SyncFileProcess extends SwingWorker { } } - public JSONArray getSyncFailedPlugins(){ - return syncFailedPlugins; - } /** * 下载成功 diff --git a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java index efd809e791..6214f1cfa9 100644 --- a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java +++ b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java @@ -27,6 +27,8 @@ public class DesignerPushUpdateManager { private DesignerUpdateInfo updateInfo; + private boolean shouldPopUp = false; + private DesignerPushUpdateManager() { } @@ -91,13 +93,14 @@ public class DesignerPushUpdateManager { * 检查更新,如果有合适的更新版本,则弹窗 */ private void checkAndPop() { + if (!shouldPopUp()) { + this.shouldPopUp = true; + FineLoggerFactory.getLogger().debug("skip push update"); + return; + } checkUpdateService.execute(new Runnable() { @Override public void run() { - if (!shouldPopUp()) { - FineLoggerFactory.getLogger().debug("skip push update"); - return; - } final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); DesignerPushUpdateDialog.createAndShow(designerFrame, updateInfo); } @@ -139,6 +142,10 @@ public class DesignerPushUpdateManager { return StringUtils.isNotEmpty(prefix) && fullCurrentVersion.contains(SPLIT_CHAR); } + public boolean isShouldPopUp() { + return shouldPopUp; + } + /** * 跳转到更新升级窗口,并自动开始更新 */ diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java index 1169b7c9a6..ad933d7d24 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java @@ -18,9 +18,11 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.BbsRegisterMark; import com.fr.design.locale.impl.BbsResetMark; import com.fr.design.locale.impl.BbsSpaceMark; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.upm.event.DownloadEvent; import com.fr.design.upm.exec.UpmBrowserExecutor; import com.fr.design.upm.task.UpmTaskWorker; +import com.fr.design.utils.BrowseUtils; import com.fr.event.EventDispatcher; import com.fr.general.GeneralUtils; import com.fr.general.locale.LocaleCenter; @@ -424,7 +426,8 @@ public class UpmBridge { public void getPriviteMessage() { try { LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); - Desktop.getDesktop().browse(new URI(spaceMark.getValue())); + String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(spaceMark.getValue()); + BrowseUtils.browser(ssoUrl); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java index 46622c44d8..9fa6980e9d 100644 --- a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -2,13 +2,11 @@ package com.fr.design.versioncheck; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; -import com.fr.design.dialog.NotificationDialog; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.RemoteWorkspace; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.env.CheckServiceDialog; import com.fr.env.VersionCheckMessageDialog; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; @@ -24,6 +22,7 @@ import com.fr.plugin.manage.control.PluginControllerHelper; import com.fr.plugin.manage.control.PluginTaskCallback; import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.manage.control.ProgressCallback; +import com.fr.report.ReportHelper; import com.fr.rpc.Result; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; @@ -33,9 +32,6 @@ import com.fr.workspace.engine.base.FineObjectPool; import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import com.fr.workspace.engine.exception.WorkspaceConnectionException; import com.fr.workspace.engine.rpc.WorkspaceProxyPool; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.lang.reflect.Method; import java.text.ParsePosition; import java.text.SimpleDateFormat; @@ -206,10 +202,7 @@ public class VersionCheckUtils { } private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { - if (selectedEnv.getType() == DesignerWorkspaceType.Remote) { - return true; - } - return false; + return selectedEnv.getType() == DesignerWorkspaceType.Remote; } public static JSONArray checkLocalAndRemotePlugin() { @@ -221,21 +214,26 @@ public class VersionCheckUtils { localPluginsMap.put(pluginContext.getID(), pluginContext); } JSONObject remotePlugin; + Map pluginsNameMap = ReportHelper.getPluginNameMap(); for (int i = 0; i < remotePlugins.size(); i++) { remotePlugin = remotePlugins.getJSONObject(i); - if (localPluginsMap.containsKey(remotePlugin.getString(ID))) { - if (ComparatorUtils.equals(localPluginsMap.get(remotePlugin.getString(ID)).getVersion(), remotePlugin.getString(VERSION))) { + if (ComparatorUtils.equals(remotePlugin.getString("running"), "false")) { + continue; + } + String remotePluginID = remotePlugin.getString(ID); + if (localPluginsMap.containsKey(remotePluginID)) { + if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) { continue; } else { if (remotePlugin.getString(NAME) == null) { - remotePlugin.put(NAME, localPluginsMap.get(remotePlugin.getString(ID)).getName()); + remotePlugin.put(NAME, localPluginsMap.get(remotePluginID).getName()); } remotePlugin.put("type", INCONSISTENCY); } } else { remotePlugin.put("type", MISSING); if (remotePlugin.getString(NAME) == null) { - remotePlugin.put(NAME, remotePlugin.getString("id")); + remotePlugin.put(NAME, pluginsNameMap.getOrDefault(remotePluginID, remotePluginID)); } } differentPlugins.put(remotePlugin); @@ -303,7 +301,7 @@ public class VersionCheckUtils { return uninstallFailedID; } - private static JSONArray getPluginsSyncFailed(JSONArray differentPlugins){ + private static JSONArray getPluginsSyncFailed(JSONArray differentPlugins) { JSONArray pluginsNeedSync = JSONArray.create(); List localPlugins = PluginManager.getContexts(); Map localPluginsInfo = new HashMap<>(); @@ -333,7 +331,9 @@ public class VersionCheckUtils { @Override public void done(PluginTaskResult result) { latch.countDown(); - FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID()); + if(result.isSuccess()) { + FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID()); + } } }); } diff --git a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java index 222a9a2a57..185268e79c 100644 --- a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java @@ -308,32 +308,30 @@ public class CheckServiceDialog extends JDialog implements ActionListener { private MouseListener syncButtonClickListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { + ignoreButton.setEnabled(false); String[] option = {Toolkit.i18nText("Fine-Design_Report_Yes"), Toolkit.i18nText("Fine-Design_Report_No")}; - int a = FineJOptionPane.showOptionDialog(getParent(), Toolkit.i18nText("Fine-Design_Basic_Sync_Info_Information"), - Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, IOUtils.readIcon("com/fr/design/icon/versioncheck/question.png"), option, 1); - if (0 == a) { - //jar包一致的话只更新插件 - progressBar.setVisible(true); - progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); - syncButton.setEnabled(false); - if (!jarConsistency) { + if (!jarConsistency) { + int a = FineJOptionPane.showOptionDialog(getParent(), Toolkit.i18nText("Fine-Design_Basic_Sync_Info_Information"), + Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, IOUtils.readIcon("com/fr/design/icon/versioncheck/question.png"), option, 1); + if (0 == a) { + progressBar.setVisible(true); + progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); + syncButton.setEnabled(false); deletePreviousPropertyFile(); final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); final JFrame frame = DesignerContext.getDesignerFrame(); final RestartHelper helper = new RestartHelper(); FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); - SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(),JSONArray.create()); - new SyncFileProcess(progressBar, remoteBuildNo) { + SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(frame, JSONArray.create()); + new SyncFileProcess(progressBar, remoteBuildNo, syncFailedPluginsDialog) { @Override public void onDownloadSuccess() { deleteForDesignerUpdate(installLib); progressBar.setVisible(false); - JSONArray syncFailedPlugins = getSyncFailedPlugins(); - if (syncFailedPlugins.size() > 0) { - syncFailedPluginsDialog.showSyncFailedPluginsInfo(syncFailedPlugins); - syncFailedPluginsDialog.setVisible(true); + syncFailedPluginsDialog.showDialog(); + if (!syncFailedPluginsDialog.restartClicked()) { + helper.restartForUpdate(frame); } - helper.restartForUpdate(frame); } @Override @@ -345,39 +343,39 @@ public class CheckServiceDialog extends JDialog implements ActionListener { helper.restartForUpdate(frame); } }.execute(); - } else { - //到这边说明主jar是一致的,就只尝试同步插件 - new SwingWorker() { - - @Override - protected JSONArray doInBackground() { - progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); - progressBar.setValue(0); - return VersionCheckUtils.syncPlugins(differentPlugins); + } + } else { + //到这边说明主jar是一致的,就只尝试同步插件 + new SwingWorker() { + + @Override + protected JSONArray doInBackground() { + progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); + progressBar.setValue(0); + return VersionCheckUtils.syncPlugins(differentPlugins); + } + + @Override + protected void done() { + progressBar.setVisible(false); + JSONArray syncFailedPlugins = null; + try { + syncFailedPlugins = get(); + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); } - - @Override - protected void done() { - progressBar.setVisible(false); - JSONArray syncFailedPlugins = null; - try { - syncFailedPlugins = get(); - } catch (Exception ex) { - FineLoggerFactory.getLogger().error(ex.getMessage(), ex); - } - if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { - SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); - syncFailedPluginsDialog.setVisible(true); - } else { - FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Sync_Success"), - Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), - FineJOptionPane.INFORMATION_MESSAGE); - } - close(); + if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { + SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); + syncFailedPluginsDialog.setVisible(true); + } else { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Sync_Success"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + FineJOptionPane.INFORMATION_MESSAGE); } - }.execute(); - } + close(); + } + }.execute(); } } }; diff --git a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java index 0a9faab55a..7e053db424 100644 --- a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java +++ b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java @@ -10,6 +10,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.CloudCenter; +import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.json.JSONArray; @@ -25,6 +26,7 @@ import java.util.Locale; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -39,7 +41,11 @@ public class SyncFailedPluginsDialog extends JDialog { private UILabel detailsLabel; private JScrollPane scrollPane; private UITextArea detailsTextArea; - public SyncFailedPluginsDialog(Frame parent, JSONArray syncFailedPlugins) { + private JFrame frame = DesignerContext.getDesignerFrame(); + private RestartHelper restartHelper = new RestartHelper(); + private UIButton restartButton; + private boolean show = false; + public SyncFailedPluginsDialog(JFrame parent, JSONArray syncFailedPlugins) { super(parent, true); JPanel body = FRGUIPaneFactory.createBorderLayout_L_Pane(); @@ -79,7 +85,7 @@ public class SyncFailedPluginsDialog extends JDialog { centerPanel.add(scrollPane,BorderLayout.CENTER); JPanel southPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - UIButton restartButton = new UIButton(Toolkit.i18nText("Fine-Design_Updater_Restart_Designer")); + restartButton = new UIButton(Toolkit.i18nText("Fine-Design_Updater_Restart_Designer")); restartButton.addMouseListener(restartButtonClickListener); southPane.add(restartButton); @@ -104,6 +110,15 @@ public class SyncFailedPluginsDialog extends JDialog { detailsText.append(plugin.getString("name")).append(",").append(Toolkit.i18nText("Fine-Design_Basic_Sync_Server_Version")).append(plugin.getString("version")).append("\n"); } detailsTextArea.setText(detailsText.toString()); + if(!ComparatorUtils.equals(detailsTextArea.getText(),StringUtils.EMPTY)){ + show = true; + } + } + + public void showDialog(){ + if(show){ + this.setVisible(true); + } } private MouseListener detailsLabelClickListener = new MouseAdapter() { @@ -119,10 +134,15 @@ public class SyncFailedPluginsDialog extends JDialog { } }; + public boolean restartClicked(){ + return !restartButton.isEnabled(); + } + private MouseListener restartButtonClickListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { - RestartHelper.restartForUpdate(DesignerContext.getDesignerFrame()); + restartButton.setEnabled(false); + restartHelper.restartForUpdate(frame); } }; } diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js index 37cecf414d..162f7d1b35 100644 --- a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js @@ -1,5 +1,59 @@ var Store = { i18n : { + 'Designer-Login_User_Name': 'Username/Email/Phone number', + 'Designer-Login_User_Name_Hint': 'Please enter username/email/phone number', + 'Designer-Login_Password': 'Password', + 'Designer-Login_Password_Hint': 'Please enter the password', + 'Designer-Login': 'Login', + 'Designer-Login_Title': 'FanRuan Passport Login', + 'Designer-Login_I_Have_Read': 'I have read', + 'Designer-Login_Service_Terms': 'Terms of Service', + 'Designer-Login_Forget_Password': 'Forgot your password?', + 'Designer-Login_Sms': 'SMS login', + 'Designer-Login_Normal': 'Password login', + 'Designer-Login_Phone': 'Phone number', + 'Designer-Login_Phone_Hint': 'Please enter your phone number', + 'Designer-Login_Code': 'Captcha', + 'Designer-Login_Code_Hint': 'Please enter the captcha', + 'Designer-Login_Code_Request': 'Get captcha', + 'Designer-Login_Code_Request_Again': 'Re-acquire', + 'Designer-Login_Register_Or_Login': 'Register/Login', + 'Designer-Basic_Chinese_Mainland': 'Mainland China', + 'Designer-Basic_Chinese_Hong_Kong': 'Hong Kong', + 'Designer-Basic_Chinese_Macao': 'Macao', + 'Designer-Basic_Chinese_Taiwan': 'Taiwan', + 'Designer-Basic_Turkey': 'Turkey', + 'Designer-Basic_South_Korea': 'South Korea', + 'Designer-Basic_Japan': 'Japan', + 'Designer-Basic_Singapore': 'Singapore', + 'Designer-Basic_Malaysia': 'Malaysia', + 'Designer-Login_Username_Not_Null': 'Username cannot be empty', + 'Designer-Login_Password_Not_Null': 'Password cannot be empty', + 'Designer-Login_Username_Or_Password_Incorrect': 'The username or password is incorrect, please check', + 'Designer-Login_Phone_Not_Null': 'The phone number format is illegal', + 'Designer-Login_Code_Not_Null': 'The captcha cannot be empty', + 'Designer-Login_Code_Incorrect': 'The captcha has expired, please get it again', + 'Designer-Login_Password_Setting_Hint': 'Enter the login password (6-16 digits password can be entered)', + 'Designer-Login_Store_User_Not_Exist': 'The username does not exist', + 'Designer-Login_Store_User_Password_Error': 'Username or password is incorrect', + 'Designer-Login_Token_Request_Failed': 'Failed to get registration token', + 'Designer-Login_Unexpected_Error': 'Unexpected error', + 'Designer-Login_Internal_Error': 'Server internal error', + 'Designer-Guide_Do_Not_Remind': 'No reminders within one month', + 'Designer-Guide_Login': 'Login now', + 'Designer-BBS_Register_Timeout': 'Register timeout, please resend the captcha', + 'Designer-BBS_Phone_Is_Register': 'The phone number is already registered', + 'Designer-BBS_Captcha_Send_Exceed_Limit': 'The captcha can only be sent once every 60s', + 'Designer-BBS_Phone_Format_Error': 'Failed to send, the phone number format is incorrect', + 'Designer-BBS_Captcha_Out_Of_Date': 'The captcha has expired, please get it again', + 'Designer-BBS_Captcha_Try_Exceed_Limit': 'The number of attempts of the captcha has reached the upper limit, please get it again', + 'Designer-BBS_Captcha_Error': 'Captcha error', + 'Designer-BBS_Username_Format_Error': 'The nickname only supports Chinese, English and numbers', + 'Designer-BBS_Username_Too_Short': 'The length of the nickname is too short', + 'Designer-BBS_Username_Too_Long': 'The length of this nickname has reached the upper limit', + 'Designer-BBS_Username_Is_Register': 'The user has been registered', + 'Designer-BBS_Please_Enter_Correct_Phone': 'Please enter the correct phone number', + 'Designer-Login_Network_Connected_Failed': 'Network connection failed', }} window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js index 37cecf414d..455998282c 100644 --- a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js @@ -1,5 +1,59 @@ var Store = { i18n : { + 'Designer-Login_User_Name': 'ユーザ名/メールアドレス/携帯番号', + 'Designer-Login_User_Name_Hint': 'ユーザ名/メールアドレス/携帯番号を入力してください。', + 'Designer-Login_Password': 'パスワード', + 'Designer-Login_Password_Hint': 'パスワードを入力してください。', + 'Designer-Login': 'ログイン', + 'Designer-Login_Title': 'FanRuanアカウントでログイン', + 'Designer-Login_I_Have_Read': '承認する', + 'Designer-Login_Service_Terms': '利用規約', + 'Designer-Login_Forget_Password': 'パスワードをお忘れですか', + 'Designer-Login_Sms': '認証コードログイン', + 'Designer-Login_Normal': 'パスワードでログイン', + 'Designer-Login_Phone': '携帯番号', + 'Designer-Login_Phone_Hint': '携帯番号を入力してください。', + 'Designer-Login_Code': '認証コード', + 'Designer-Login_Code_Hint': '認証コードを入力してください。', + 'Designer-Login_Code_Request': '認証コードを取得', + 'Designer-Login_Code_Request_Again': '再取得', + 'Designer-Login_Register_Or_Login': '登録/ログイン', + 'Designer-Basic_Chinese_Mainland': '中国大陸', + 'Designer-Basic_Chinese_Hong_Kong': '中国香港', + 'Designer-Basic_Chinese_Macao': '中国澳門', + 'Designer-Basic_Chinese_Taiwan': '中国台湾', + 'Designer-Basic_Turkey': 'トルコ共和国', + 'Designer-Basic_South_Korea': '韓国', + 'Designer-Basic_Japan': '日本', + 'Designer-Basic_Singapore': 'シンガポール', + 'Designer-Basic_Malaysia': 'マレーシア', + 'Designer-Login_Username_Not_Null': 'ユーザ名は空白不可。', + 'Designer-Login_Password_Not_Null': 'パスワードは空白不可。', + 'Designer-Login_Username_Or_Password_Incorrect': 'ユーザ名又はパスワードが間違っています。ご確認ください。', + 'Designer-Login_Phone_Not_Null': '携帯番号の形式が正しくない。', + 'Designer-Login_Code_Not_Null': '認証コードは空白不可。', + 'Designer-Login_Code_Incorrect': '認証コードが無効になりました。再取得してください。', + 'Designer-Login_Password_Setting_Hint': 'パスワードを入力してください。(6‐16桁入力可能)', + 'Designer-Login_Store_User_Not_Exist': 'ユーザ名は存在しません', + 'Designer-Login_Store_User_Password_Error': 'ユーザ名又はパスワードが間違っています。', + 'Designer-Login_Token_Request_Failed': '登録Token取得に失敗', + 'Designer-Login_Unexpected_Error': '未知のエラー', + 'Designer-Login_Internal_Error': 'サーバ内部エラー', + 'Designer-Guide_Do_Not_Remind': '一か月内アラートしません。', + 'Designer-Guide_Login': 'ログイン', + 'Designer-BBS_Register_Timeout': '登録Timeout、検証コードをもう一度取得してください。', + 'Designer-BBS_Phone_Is_Register': 'この携帯は既に登録されています。', + 'Designer-BBS_Captcha_Send_Exceed_Limit': '認証コードは60s内に一回しか送信できません。', + 'Designer-BBS_Phone_Format_Error': '携帯番号の形式が間違っています、検証コード送信失敗。', + 'Designer-BBS_Captcha_Out_Of_Date': '認証コードが無効になりました。再取得してください。', + 'Designer-BBS_Captcha_Try_Exceed_Limit': '認証コードの試行回数が上限に達しています。再取得してください。', + 'Designer-BBS_Captcha_Error': '認証コードが間違っています。', + 'Designer-BBS_Username_Format_Error': 'ユーザ名は漢字、アルバイトと数字しかサポートできません。', + 'Designer-BBS_Username_Too_Short': 'ユーザ名が短すぎます。', + 'Designer-BBS_Username_Too_Long': 'ユーザ名が長すぎます。', + 'Designer-BBS_Username_Is_Register': 'このユーザは登録済みです。', + 'Designer-BBS_Please_Enter_Correct_Phone': '正確な携帯番号を入力してください。', + 'Designer-Login_Network_Connected_Failed': 'インターネット接続失敗', }} window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js index 37cecf414d..162f7d1b35 100644 --- a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js @@ -1,5 +1,59 @@ var Store = { i18n : { + 'Designer-Login_User_Name': 'Username/Email/Phone number', + 'Designer-Login_User_Name_Hint': 'Please enter username/email/phone number', + 'Designer-Login_Password': 'Password', + 'Designer-Login_Password_Hint': 'Please enter the password', + 'Designer-Login': 'Login', + 'Designer-Login_Title': 'FanRuan Passport Login', + 'Designer-Login_I_Have_Read': 'I have read', + 'Designer-Login_Service_Terms': 'Terms of Service', + 'Designer-Login_Forget_Password': 'Forgot your password?', + 'Designer-Login_Sms': 'SMS login', + 'Designer-Login_Normal': 'Password login', + 'Designer-Login_Phone': 'Phone number', + 'Designer-Login_Phone_Hint': 'Please enter your phone number', + 'Designer-Login_Code': 'Captcha', + 'Designer-Login_Code_Hint': 'Please enter the captcha', + 'Designer-Login_Code_Request': 'Get captcha', + 'Designer-Login_Code_Request_Again': 'Re-acquire', + 'Designer-Login_Register_Or_Login': 'Register/Login', + 'Designer-Basic_Chinese_Mainland': 'Mainland China', + 'Designer-Basic_Chinese_Hong_Kong': 'Hong Kong', + 'Designer-Basic_Chinese_Macao': 'Macao', + 'Designer-Basic_Chinese_Taiwan': 'Taiwan', + 'Designer-Basic_Turkey': 'Turkey', + 'Designer-Basic_South_Korea': 'South Korea', + 'Designer-Basic_Japan': 'Japan', + 'Designer-Basic_Singapore': 'Singapore', + 'Designer-Basic_Malaysia': 'Malaysia', + 'Designer-Login_Username_Not_Null': 'Username cannot be empty', + 'Designer-Login_Password_Not_Null': 'Password cannot be empty', + 'Designer-Login_Username_Or_Password_Incorrect': 'The username or password is incorrect, please check', + 'Designer-Login_Phone_Not_Null': 'The phone number format is illegal', + 'Designer-Login_Code_Not_Null': 'The captcha cannot be empty', + 'Designer-Login_Code_Incorrect': 'The captcha has expired, please get it again', + 'Designer-Login_Password_Setting_Hint': 'Enter the login password (6-16 digits password can be entered)', + 'Designer-Login_Store_User_Not_Exist': 'The username does not exist', + 'Designer-Login_Store_User_Password_Error': 'Username or password is incorrect', + 'Designer-Login_Token_Request_Failed': 'Failed to get registration token', + 'Designer-Login_Unexpected_Error': 'Unexpected error', + 'Designer-Login_Internal_Error': 'Server internal error', + 'Designer-Guide_Do_Not_Remind': 'No reminders within one month', + 'Designer-Guide_Login': 'Login now', + 'Designer-BBS_Register_Timeout': 'Register timeout, please resend the captcha', + 'Designer-BBS_Phone_Is_Register': 'The phone number is already registered', + 'Designer-BBS_Captcha_Send_Exceed_Limit': 'The captcha can only be sent once every 60s', + 'Designer-BBS_Phone_Format_Error': 'Failed to send, the phone number format is incorrect', + 'Designer-BBS_Captcha_Out_Of_Date': 'The captcha has expired, please get it again', + 'Designer-BBS_Captcha_Try_Exceed_Limit': 'The number of attempts of the captcha has reached the upper limit, please get it again', + 'Designer-BBS_Captcha_Error': 'Captcha error', + 'Designer-BBS_Username_Format_Error': 'The nickname only supports Chinese, English and numbers', + 'Designer-BBS_Username_Too_Short': 'The length of the nickname is too short', + 'Designer-BBS_Username_Too_Long': 'The length of this nickname has reached the upper limit', + 'Designer-BBS_Username_Is_Register': 'The user has been registered', + 'Designer-BBS_Please_Enter_Correct_Phone': 'Please enter the correct phone number', + 'Designer-Login_Network_Connected_Failed': 'Network connection failed', }} window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js index 37cecf414d..2cef831517 100644 --- a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js @@ -1,5 +1,59 @@ var Store = { i18n : { + 'Designer-Login_User_Name': '帳號/郵箱/手機號', + 'Designer-Login_User_Name_Hint': '請輸入帳號/郵箱/手機號', + 'Designer-Login_Password': '密碼', + 'Designer-Login_Password_Hint': '請輸入密碼', + 'Designer-Login': '登入', + 'Designer-Login_Title': '帆軟通行證登入', + 'Designer-Login_I_Have_Read': '我已閱讀', + 'Designer-Login_Service_Terms': '服務條款', + 'Designer-Login_Forget_Password': '忘記密碼?', + 'Designer-Login_Sms': '驗證碼登入', + 'Designer-Login_Normal': '密碼登入', + 'Designer-Login_Phone': '手機號碼', + 'Designer-Login_Phone_Hint': '請輸入手機號碼', + 'Designer-Login_Code': '驗證碼', + 'Designer-Login_Code_Hint': '請輸入驗證碼', + 'Designer-Login_Code_Request': '獲取驗證碼', + 'Designer-Login_Code_Request_Again': '重新獲取', + 'Designer-Login_Register_Or_Login': '註冊/登入', + 'Designer-Basic_Chinese_Mainland': '中國大陸', + 'Designer-Basic_Chinese_Hong_Kong': '中國香港', + 'Designer-Basic_Chinese_Macao': '中國澳門', + 'Designer-Basic_Chinese_Taiwan': '中國臺灣', + 'Designer-Basic_Turkey': '土耳其', + 'Designer-Basic_South_Korea': '韓國', + 'Designer-Basic_Japan': '日本', + 'Designer-Basic_Singapore': '新加坡', + 'Designer-Basic_Malaysia': '馬來西亞', + 'Designer-Login_Username_Not_Null': '使用者名稱不能為空', + 'Designer-Login_Password_Not_Null': '密碼不能為空', + 'Designer-Login_Username_Or_Password_Incorrect': '使用者名稱或者密碼錯誤,請檢查', + 'Designer-Login_Phone_Not_Null': '手機號碼格式不正確', + 'Designer-Login_Code_Not_Null': '驗證碼不能為空', + 'Designer-Login_Code_Incorrect': '驗證碼已過期,請重新獲取', + 'Designer-Login_Password_Setting_Hint': '輸入登入密碼(可輸入6-16位密碼)', + 'Designer-Login_Store_User_Not_Exist': '帳號不存在', + 'Designer-Login_Store_User_Password_Error': '帳號或密碼錯誤', + 'Designer-Login_Token_Request_Failed': '註冊令牌獲取失敗', + 'Designer-Login_Unexpected_Error': '未知錯誤', + 'Designer-Login_Internal_Error': '伺服器內部錯誤', + 'Designer-Guide_Do_Not_Remind': '一個月內不再提醒', + 'Designer-Guide_Login': '立即登入', + 'Designer-BBS_Register_Timeout': '註冊超時,請重新發送驗證碼', + 'Designer-BBS_Phone_Is_Register': '該手機號碼已註冊', + 'Designer-BBS_Captcha_Send_Exceed_Limit': '驗證碼每60s只能傳送一次', + 'Designer-BBS_Phone_Format_Error': '傳送失敗,手機號格式錯誤', + 'Designer-BBS_Captcha_Out_Of_Date': '驗證碼已過期,請重新獲取', + 'Designer-BBS_Captcha_Try_Exceed_Limit': '驗證碼嘗試次數已達上限,請重新獲取', + 'Designer-BBS_Captcha_Error': '驗證碼錯誤', + 'Designer-BBS_Username_Format_Error': '暱稱只支援中英文和數字', + 'Designer-BBS_Username_Too_Short': '暱稱長度太短', + 'Designer-BBS_Username_Too_Long': '這個暱稱長度已經達到了上限', + 'Designer-BBS_Username_Is_Register': '該帳號已被註冊', + 'Designer-BBS_Please_Enter_Correct_Phone': '請輸入正確的手機號', + 'Designer-Login_Network_Connected_Failed': '網路連線失敗', }} window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/login.js b/designer-base/src/main/resources/com/fr/design/login/login.js index 49fe1bcfaf..cec6fd34b1 100644 --- a/designer-base/src/main/resources/com/fr/design/login/login.js +++ b/designer-base/src/main/resources/com/fr/design/login/login.js @@ -1 +1 @@ -!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=4)}([function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){n===undefined&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){n===undefined&&(n=i),e[n]=t[i]}),o=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),o(i(5),t)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=window.DesignerLoginHelper,o=function(){function e(){}return e.prototype.getParams=function(){return{designerLoginSource:window.designerLoginSource||"0",lastLoginType:window.lastLoginType||"-1",lastLoginAccount:window.lastLoginAccount||""}},e.prototype.closeWindow=function(e){n&&n.closeWindow(e)},e.prototype.serviceHref=function(){n?n.serviceHref():window.open("https://bbs.fanruan.com/thread-102821-1-1.html")},e.prototype.forgetHref=function(){n?n.forgetHref():window.open("https://id.fanruan.com/forget/forget.php?clue=activityf")},e.prototype.normalLogin=function(e,t,i){n?n.normalLogin(e,t,i):i(-1)},e.prototype.sendCaptcha=function(e,t,i){n?n.sendCaptcha(e,t,i):i(-1)},e.prototype.smsLogin=function(e,t,i,o){n?n.smsLogin(e,t,i,o):o(null)},e.prototype.smsRegister=function(e,t,i,o,s){n?n.smsRegister(e,t,i,o,s):s(-1)},e.prototype.resize=function(e,t){n&&n.resize(e,t)},e}();t["default"]=new o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BBS_ERROR_CODE=t.NORMAL_LOGIN_RESULT=t.REGION=t.LOGIN=void 0,t.LOGIN={NORMAL_METHOD:"normal",SMS_METHOD:"sms",TABS:{LOGIN:"login",FORGET_PASSWORD:"forget",RESET_PASSWORD:"reset",REGISTER:"register"}},t.REGION=[{value:"+86",text:"Designer-Basic_Chinese_Mainland"},{value:"+886",text:"Designer-Basic_Chinese_Taiwan"},{value:"+852",text:"Designer-Basic_Chinese_Hong_Kong"},{value:"+853",text:"Designer-Basic_Chinese_Macao"},{value:"+90",text:"Designer-Basic_Turkey"},{value:"+82",text:"Designer-Basic_South_Korea"},{value:"+81",text:"Designer-Basic_Japan"},{value:"+65",text:"Designer-Basic_Singapore"},{value:"+60",text:"Designer-Basic_Malaysia"}],t.NORMAL_LOGIN_RESULT=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-Login_Store_User_Not_Exist"},{status:-2,message:"Designer-Login_Store_User_Password_Error"},{status:-3,message:"Designer-Login_Unexpected_Error"},{status:-4,message:"Designer-Login_Network_Connected_Failed"}],t.BBS_ERROR_CODE=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-BBS_Register_Timeout"},{status:-2,message:"Designer-BBS_Phone_Is_Register"},{status:-3,message:"Designer-BBS_Captcha_Send_Exceed_Limit"},{status:-4,message:"Designer-BBS_Phone_Format_Error"},{status:-100,message:"Designer-BBS_Captcha_Out_Of_Date"},{status:-101,message:"Designer-BBS_Captcha_Try_Exceed_Limit"},{status:-102,message:"Designer-BBS_Captcha_Error"},{status:-104,message:"Designer-BBS_Username_Format_Error"},{status:-103,message:"Designer-BBS_Please_Enter_Correct_Phone"},{status:-105,message:"Designer-BBS_Username_Too_Short"},{status:-106,message:"Designer-BBS_Username_Too_Long"},{status:-107,message:"Designer-BBS_Phone_Is_Register"},{status:-108,message:"Designer-BBS_Username_Is_Register"}]},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getError=void 0,t.getError=function(e,t){var i=BI.find(e,(function(e,i){return i.status===t}));return i&&i.message?i.message:""}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),o=i(6);BI.addI18n(Store.i18n),BI.createWidget({type:n.Vertical,element:"body",items:[{type:o["default"]}]})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListView=t.VirtualGroup=t.LeftRightVerticalAdapt=t.Left=t.Horizontal=t.Vertical=t.Absolute=t.Layout=t.Htape=t.CenterAdapt=t.Vtape=t.HorizontalAdapt=t.VerticalAdapt=t.BubbleCombo=t.Img=t.Tab=t.SingleSelectInsertCombo=t.SingleSelectRadioItem=t.MultiTreePopupView=t.Editor=t.NicEditor=t.RichEditor=t.MultiTreeCombo=t.DynamicDateTimeCombo=t.DynamicDateCombo=t.BarPopOver=t.MultiSelectItem=t.TextAreaEditor=t.AllValueChooserCombo=t.ButtonGroup=t.MultiSelectInsertCombo=t.TextEditor=t.Button=t.SignEditor=t.MultiFileEditor=t.SmallTextEditor=t.HtmlLabel=t.Label=t.DownListCombo=t.TextButton=t.IconChangeButton=t.IconButton=t.IconTextIconItem=t.IconTextItem=void 0,t.IconTextItem="bi.icon_text_item",t.IconTextIconItem="bi.icon_text_icon_item",t.IconButton="bi.icon_button",t.IconChangeButton="bi.icon_change_button",t.TextButton="bi.text_button",t.DownListCombo="bi.down_list_combo",t.Label="bi.label",t.HtmlLabel="bi.html_label",t.SmallTextEditor="bi.small_text_editor",t.MultiFileEditor="bi.multifile_editor",t.SignEditor="bi.sign_editor",t.Button="bi.button",t.TextEditor="bi.text_editor",t.MultiSelectInsertCombo="bi.multi_select_insert_combo",t.ButtonGroup="bi.button_group",t.AllValueChooserCombo="bi.all_value_chooser_combo",t.TextAreaEditor="bi.textarea_editor",t.MultiSelectItem="bi.multi_select_item",t.BarPopOver="bi.bar_popover",t.DynamicDateCombo="bi.dynamic_date_combo",t.DynamicDateTimeCombo="bi.dynamic_date_time_combo",t.MultiTreeCombo="bi.multi_tree_combo",t.RichEditor="bi.rich_editor",t.NicEditor="bi.nic_editor",t.Editor="bi.editor",t.MultiTreePopupView="bi.multi_tree_popup_view",t.SingleSelectRadioItem="bi.single_select_radio_item",t.SingleSelectInsertCombo="bi.single_select_insert_combo",t.Tab="bi.tab",t.Img="bi.img",t.BubbleCombo="bi.bubble_combo",t.VerticalAdapt="bi.vertical_adapt",t.HorizontalAdapt="bi.horizontal_adapt",t.Vtape="bi.vtape",t.CenterAdapt="bi.center_adapt",t.Htape="bi.htape",t.Layout="bi.layout",t.Absolute="bi.absolute",t.Vertical="bi.vertical",t.Horizontal="bi.horizontal",t.Left="bi.left",t.LeftRightVerticalAdapt="bi.left_right_vertical_adapt",t.VirtualGroup="bi.virtual_group",t.ListView="bi.list_view"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(7),s=i(8),r=i(9),a=i(11);i(24),t.className="designer.login.login",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login",width:420},_store:function(){return BI.Models.getModel(o["default"])},watch:{loading:function(e){this.loading.setVisible(e)}},render:function(){return{type:n.Vertical,cls:"designer-login",items:[{el:{type:n.HorizontalAdapt,items:[{type:s["default"],rgap:14,tgap:14}]}},{el:{type:n.Vertical,items:[{type:r["default"]},{type:a["default"]}]},lgap:15,rgap:15,bgap:15}]}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});BI.model("designer.login.login.model",BI.inherit(Fix.Model,{childContext:["loading"],state:function(){return{loading:!1}}})),t["default"]="designer.login.login.model"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(1);t.className="designer.login.login.close.button",t.Widget=BI.inherit(BI.Widget,{render:function(){return{type:n.TextButton,text:String.fromCharCode(10005),cls:"background-login-close",width:18.38,height:18.38,handler:function(){o["default"].closeWindow(!1)}}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0);i(10),t.className="designer.login.login.title",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-title"},render:function(){return{type:n.Label,text:BI.i18nText("Designer-Login_Title"),cls:"bi-font-bold",bgap:10}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(12);i(13);var s=i(14),r=i(16),a=i(18),l=i(2),u=i(1),g=249.64,c=331.64,d=422,f=478,p=560;t.className="designer.login.login.body",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(o["default"])},watch:{loginMethod:function(e){this.tabOption.setValue(e),this.tab.setSelect(e),this.foot.setLoginMethod(e),this.refreshLoginButton(),e===l.LOGIN.NORMAL_METHOD?(this.tab.setHeight(g),u["default"].resize(d,f)):this.model.expand&&(u["default"].resize(d,p),this.tab.setHeight(c))},approve:function(e){this.refreshLoginButton()},expand:function(e){e&&(u["default"].resize(d,p),this.tab.setHeight(c))}},render:function(){var e=this;return{type:n.Vertical,cls:"designer-login-body",items:[{type:n.ButtonGroup,value:this.model.loginMethod,ref:function(t){e.tabOption=t},layouts:[{type:n.HorizontalAdapt}],items:[{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.SMS_METHOD,text:BI.i18nText("Designer-Login_Sms")},{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.NORMAL_METHOD,text:BI.i18nText("Designer-Login_Normal")}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(t){e.store.setLoginMethod(t)}}],tgap:24,lgap:75,rgap:75},{type:n.CenterAdapt,tgap:35,items:[{type:n.Tab,cardCreator:BI.bind(this.createCard,this),showIndex:this.model.loginMethod,ref:function(t){e.tab=t},height:g,width:280}]},{type:s["default"],lgap:50,rgap:50,bgap:30,ref:function(t){e.foot=t},refreshStatus:function(t){e.store.setApprove(t)}}]}},mounted:function(){var e=u["default"].getParams(),t=e.designerLoginSource,i=e.lastLoginType;if("2"===t){var n="0"===i?l.LOGIN.NORMAL_METHOD:l.LOGIN.SMS_METHOD;this.store.setLoginMethod(n)}},createCard:function(e){var t=this;switch(e){case l.LOGIN.NORMAL_METHOD:return{type:r["default"],ref:function(e){t.normalMethod=e}};case l.LOGIN.SMS_METHOD:default:return{type:a["default"],ref:function(e){t.smsMethod=e},expand:function(){t.store.setExpand(!0)}}}},refreshLoginButton:function(){this.model.loginMethod===l.LOGIN.NORMAL_METHOD?this.normalMethod.setApprove(this.model.approve):this.smsMethod.setApprove(this.model.approve)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0;var n=i(2);t.className="designer.login.model.login.body",t.Model=BI.inherit(Fix.Model,{context:["loading"],state:function(){return{loginMethod:n.LOGIN.SMS_METHOD,approve:!0,expand:!1}},actions:{setLoginMethod:function(e){this.model.loginMethod=e},setApprove:function(e){this.model.approve=e},setExpand:function(e){this.model.expand=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(1),o=i(0);i(15);var s=i(2);t.className="designer.login.login.foot",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-foot"},render:function(){var e=this,t=this.options;return{type:o.LeftRightVerticalAdapt,items:{left:[{type:o.MultiSelectItem,width:30,selected:!0,handler:function(){t.refreshStatus(this.isSelected())}},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:BI.i18nText("Designer-Login_I_Have_Read")},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:"《"},{type:o.TextButton,cls:"login-link",textAlign:"left",text:BI.i18nText("Designer-Login_Service_Terms"),handler:function(){n["default"].serviceHref()}},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:"》"}],right:[{type:o.TextButton,cls:"login-link",textAlign:"right",text:BI.i18nText("Designer-Login_Forget_Password"),invisible:!0,ref:function(t){e.forgetPassword=t},handler:function(){n["default"].forgetHref()}}]}}},setLoginMethod:function(e){e===s.LOGIN.NORMAL_METHOD?this.forgetPassword.setVisible(!0):this.forgetPassword.setVisible(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(3),s=i(1),r=i(17),a=i(2);t.className="designer.login.login.normal",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(r["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)}},render:function(){var e=this;return{type:n.Vertical,items:[{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_User_Name"),bgap:3},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_User_Name_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.userName=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Hint"),inputType:"password",allowBlank:!0,height:40,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:10,ref:function(t){e.errMessage=t}},{type:n.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()}}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=s["default"].getParams(),i=t.designerLoginSource,n=t.lastLoginType,o=t.lastLoginAccount;"2"===i&&"0"===n&&e.userName.setValue(o)},checkUsername:function(){var e=this.userName.getValue();e&&this.userName.setValue(e.replace(/\s+/g,""))},login:function(){var e=this;e.checkUsername();var t=this.userName.getValue(),i=this.password.getValue();t?i?s["default"].normalLogin(t,i,(function(t){var i=parseInt(t,10);if(i>0)s["default"].closeWindow(!0);else{var n=o.getError(a.NORMAL_LOGIN_RESULT,i);n&&e.store.setErrMessage(BI.i18nText(n))}})):this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null")):this.store.setErrMessage(BI.i18nText("Designer-Login_Username_Not_Null"))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.normal_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:""}},actions:{setErrMessage:function(e){this.model.errMessage=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(19),s=i(21),r=i(22),a=i(2),l=i(23),u=i(1),g=i(3);t.className="designer.login.login.sms",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(l["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)},isRegister:function(e){var t=this.options;e&&(t.expand(),this.password.setVisible(!0),this.passwordLabel.setVisible(!0))}},render:function(){var e=this,t=this;return{type:n.Vertical,items:[{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Phone"),bgap:3},{type:n.HorizontalAdapt,bgap:7,items:[{type:o["default"],height:42,textFormatter:function(e){var i=t.getNumberTypeItem(e);return{value:i.value,text:BI.i18nText(i.text)}},value:a.REGION[0].value,items:BI.map(a.REGION,(function(e,t){return{type:s["default"],value:t.value,label:BI.i18nText(t.text),text:t.value}})),ref:function(t){e.regionCode=t}},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_Phone_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.phone=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Code"),bgap:3},{type:n.Horizontal,bgap:7,items:[{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Code_Hint"),inputType:"text",allowBlank:!0,height:40,width:200,ref:function(t){e.code=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:r["default"],height:40,width:80,ref:function(t){e.accountCaptcha=t},listeners:[{eventName:"EVENT_SEND",action:function(){t.sendCaptcha()}}]}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3,invisible:!0,ref:function(t){e.passwordLabel=t}},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Setting_Hint"),inputType:"password",allowBlank:!0,height:40,invisible:!0,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:11,ref:function(t){e.errMessage=t}},{type:n.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login_Register_Or_Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()}}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=u["default"].getParams(),i=t.designerLoginSource,n=t.lastLoginType,o=t.lastLoginAccount;if("2"===i&&"1"===n){var s=o.split("-")[0],r=o.split("-")[1];e.regionCode.setValue(s),e.phone.setValue(r)}},getNumberTypeItem:function(e){return BI.find(a.REGION,(function(t,i){return e===i.value}))||{}},checkPhone:function(){var e=this.phone.getValue();e&&this.phone.setValue(e.replace(/\s+/g,""))},login:function(){var e=this,t=this;t.checkPhone();var i=this.phone.getValue(),n=this.code.getValue();if(i)if(n){var o=this.regionCode.getValue();if(this.model.isRegister){var s=this.password.getValue();if(!s)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null"));var r=this.model.regToken;if(!r)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"));u["default"].smsRegister(o,i,s,r,(function(e){var i=parseInt(e,10);if(i>0)u["default"].closeWindow(!0);else{var n=g.getError(a.BBS_ERROR_CODE,i);n&&t.store.setErrMessage(BI.i18nText(n))}}))}else u["default"].smsLogin(o,i,n,(function(i){var n=JSON.parse(i);if(n.status>0)if(!0===n.register){var o=n.regtoken;o?(t.store.setRegister(!0),t.store.setRegToken(o)):e.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"))}else u["default"].closeWindow(!0);else{var s=g.getError(a.BBS_ERROR_CODE,n.status);s&&t.store.setErrMessage(BI.i18nText(s))}}))}else this.store.setErrMessage(BI.i18nText("Designer-Login_Code_Not_Null"));else this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"))},sendCaptcha:function(){var e=this;e.checkPhone();var t=this.phone.getValue();if(!t)return e.accountCaptcha.setButtonEnable(!0),void this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"));var i=this.regionCode.getValue();u["default"].sendCaptcha(i,t,(function(t){var i=parseInt(t,10);if(1===i)e.accountCaptcha.regainCaptcha();else{if(e.accountCaptcha.setButtonEnable(!0),0===i)return void e.store.setErrMessage(BI.i18nText("Designer-BBS_Please_Enter_Correct_Phone"));var n=g.getError(a.BBS_ERROR_CODE,i);n&&e.store.setErrMessage(BI.i18nText(n))}}))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(20);t.className="designer.left_right_text_value_combo",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,textFormatter:function(e){return e},value:""},render:function(){var e=this,t=this.options;return{type:"bi.combo",container:t.container,adjustLength:2,ref:function(t){e.combo=t},el:{type:n["default"],cls:"text-value-trigger",items:t.items,height:t.height-2,value:t.textFormatter(t.value),ref:function(t){e.trigger=t}},popup:{el:{type:"bi.text_value_combo_popup",chooseType:t.chooseType,value:t.value,items:t.items,ref:function(t){e.popup=t},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){e.setValue(e.getValue()),e.combo.hideView(),e.fireEvent("EVENT_CHANGE",arguments)}},{eventName:BI.Controller.EVENT_CHANGE,action:function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},value:t.value,maxHeight:240,minHeight:25}}},setValue:function(e){this.combo.setValue(e),this.trigger.setValue(this.options.textFormatter(e))},getValue:function(){var e=this.combo.getValue();return BI.isNull(e)?"":BI.isArray(e)?e[0]:e},populate:function(e){this.options.items=e,this.combo.populate(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.left_right_text_value_combo_trigger",t.Widget=BI.inherit(BI.Trigger,{props:{baseCls:"",value:{}},render:function(){var e=this,t=this.options,i=t.value;return{type:"bi.htape",cls:"bi-border-bottom bi-border-radius",items:[{type:"bi.label",text:i.text,title:function(){return e.textRow.getText()},height:t.height,hgap:3,textAlign:"left",ref:function(t){e.textRow=t}},{type:"bi.label",text:i.value,height:t.height,width:32,textAlign:"right",ref:function(t){e.valueRow=t}},{type:"bi.trigger_icon_button",width:t.triggerWidth||t.height}]}},setValue:function(e){this.textRow.setText(e.text),this.valueRow.setText(e.value)},setText:function(e){this.textRow.setText(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.components.phone.editor.item",t.Widget=BI.inherit(BI.BasicButton,{props:{baseCls:"designer-login-login-body",label:"",text:""},render:function(){var e=this.options;return{type:"bi.htape",items:[{el:{type:"bi.label",text:e.label,title:e.label,textAlign:"left"},lgap:10,rgap:5},{el:{type:"bi.label",text:e.text,textAlign:"right"},width:32,rgap:10}]}},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent("EVENT_CHANGE",this.isSelected(),this)},setSelected:function(e){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)},getValue:function(){return this.options.value}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0);t.className="designer.user.account.setting.captcha",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},render:function(){var e=this;this.options;return{type:n.TextButton,text:BI.i18nText("Designer-Login_Code_Request"),cls:"designer-login-border-bottom designer-login-code-text",handler:function(){e.setButtonEnable(!1),e.fireEvent("EVENT_SEND")},ref:function(t){e.getButton=t}}},setButtonEnable:function(e){this.captchaTime&&(e=!1),this.getButton.setEnable(e)},regainCaptcha:function(){var e=this,t=0;window.clearInterval(e.captchaTime),this.captchaTime=window.setInterval((function(){if(60===t)return window.clearInterval(e.captchaTime),e.captchaTime=null,e.getButton.setText(BI.i18nText("Designer-Login_Code_Request")),void e.setButtonEnable(!0);e.getButton.setText(BI.i18nText("Designer-Login_Code_Request_Again")+"("+(60-t)+")"),t++}),1e3),this.setButtonEnable(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.sms_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:"",isRegister:!1,regToken:""}},actions:{setErrMessage:function(e){this.model.errMessage=e},setRegister:function(e){this.model.isRegister=e},setRegToken:function(e){this.model.regToken=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){}]); \ No newline at end of file +!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=4)}([function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){n===undefined&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){n===undefined&&(n=i),e[n]=t[i]}),o=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),o(i(5),t)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=window.DesignerLoginHelper,o=function(){function e(){}return e.prototype.getParams=function(){return{designerLoginSource:window.designerLoginSource||"0",lastLoginType:window.lastLoginType||"-1",lastLoginAccount:window.lastLoginAccount||""}},e.prototype.closeWindow=function(e){n&&n.closeWindow(e)},e.prototype.serviceHref=function(){n?n.serviceHref():window.open("https://bbs.fanruan.com/thread-102821-1-1.html")},e.prototype.forgetHref=function(){n?n.forgetHref():window.open("https://id.fanruan.com/forget/forget.php?clue=activityf")},e.prototype.normalLogin=function(e,t,i){n?n.normalLogin(e,t,i):i(-1)},e.prototype.sendCaptcha=function(e,t,i){n?n.sendCaptcha(e,t,i):i(-1)},e.prototype.smsLogin=function(e,t,i,o){n?n.smsLogin(e,t,i,o):o(null)},e.prototype.smsRegister=function(e,t,i,o,s){n?n.smsRegister(e,t,i,o,s):s(-1)},e.prototype.resize=function(e,t){n&&n.resize(e,t)},e}();t["default"]=new o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BBS_ERROR_CODE=t.NORMAL_LOGIN_RESULT=t.REGION=t.LOGIN=void 0,t.LOGIN={NORMAL_METHOD:"normal",SMS_METHOD:"sms",TABS:{LOGIN:"login",FORGET_PASSWORD:"forget",RESET_PASSWORD:"reset",REGISTER:"register"}},t.REGION=[{value:"+86",text:"Designer-Basic_Chinese_Mainland"},{value:"+886",text:"Designer-Basic_Chinese_Taiwan"},{value:"+852",text:"Designer-Basic_Chinese_Hong_Kong"},{value:"+853",text:"Designer-Basic_Chinese_Macao"},{value:"+90",text:"Designer-Basic_Turkey"},{value:"+82",text:"Designer-Basic_South_Korea"},{value:"+81",text:"Designer-Basic_Japan"},{value:"+65",text:"Designer-Basic_Singapore"},{value:"+60",text:"Designer-Basic_Malaysia"}],t.NORMAL_LOGIN_RESULT=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-Login_Store_User_Not_Exist"},{status:-2,message:"Designer-Login_Store_User_Password_Error"},{status:-3,message:"Designer-Login_Unexpected_Error"},{status:-4,message:"Designer-Login_Network_Connected_Failed"}],t.BBS_ERROR_CODE=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-BBS_Register_Timeout"},{status:-2,message:"Designer-BBS_Phone_Is_Register"},{status:-3,message:"Designer-BBS_Captcha_Send_Exceed_Limit"},{status:-4,message:"Designer-BBS_Phone_Format_Error"},{status:-100,message:"Designer-BBS_Captcha_Out_Of_Date"},{status:-101,message:"Designer-BBS_Captcha_Try_Exceed_Limit"},{status:-102,message:"Designer-BBS_Captcha_Error"},{status:-104,message:"Designer-BBS_Username_Format_Error"},{status:-103,message:"Designer-BBS_Please_Enter_Correct_Phone"},{status:-105,message:"Designer-BBS_Username_Too_Short"},{status:-106,message:"Designer-BBS_Username_Too_Long"},{status:-107,message:"Designer-BBS_Phone_Is_Register"},{status:-108,message:"Designer-BBS_Username_Is_Register"}]},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getError=void 0,t.getError=function(e,t){var i=BI.find(e,(function(e,i){return i.status===t}));return i&&i.message?i.message:""}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),o=i(6);BI.addI18n(Store.i18n),BI.createWidget({type:n.Vertical,element:"body",items:[{type:o["default"]}]})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListView=t.VirtualGroup=t.LeftRightVerticalAdapt=t.Left=t.Horizontal=t.Vertical=t.Absolute=t.Layout=t.Htape=t.CenterAdapt=t.Vtape=t.HorizontalAdapt=t.VerticalAdapt=t.BubbleCombo=t.Img=t.Tab=t.SingleSelectInsertCombo=t.SingleSelectRadioItem=t.MultiTreePopupView=t.Editor=t.NicEditor=t.RichEditor=t.MultiTreeCombo=t.DynamicDateTimeCombo=t.DynamicDateCombo=t.BarPopOver=t.MultiSelectItem=t.TextAreaEditor=t.AllValueChooserCombo=t.ButtonGroup=t.MultiSelectInsertCombo=t.TextEditor=t.Button=t.SignEditor=t.MultiFileEditor=t.SmallTextEditor=t.HtmlLabel=t.Label=t.DownListCombo=t.TextButton=t.IconChangeButton=t.IconButton=t.IconTextIconItem=t.IconTextItem=void 0,t.IconTextItem="bi.icon_text_item",t.IconTextIconItem="bi.icon_text_icon_item",t.IconButton="bi.icon_button",t.IconChangeButton="bi.icon_change_button",t.TextButton="bi.text_button",t.DownListCombo="bi.down_list_combo",t.Label="bi.label",t.HtmlLabel="bi.html_label",t.SmallTextEditor="bi.small_text_editor",t.MultiFileEditor="bi.multifile_editor",t.SignEditor="bi.sign_editor",t.Button="bi.button",t.TextEditor="bi.text_editor",t.MultiSelectInsertCombo="bi.multi_select_insert_combo",t.ButtonGroup="bi.button_group",t.AllValueChooserCombo="bi.all_value_chooser_combo",t.TextAreaEditor="bi.textarea_editor",t.MultiSelectItem="bi.multi_select_item",t.BarPopOver="bi.bar_popover",t.DynamicDateCombo="bi.dynamic_date_combo",t.DynamicDateTimeCombo="bi.dynamic_date_time_combo",t.MultiTreeCombo="bi.multi_tree_combo",t.RichEditor="bi.rich_editor",t.NicEditor="bi.nic_editor",t.Editor="bi.editor",t.MultiTreePopupView="bi.multi_tree_popup_view",t.SingleSelectRadioItem="bi.single_select_radio_item",t.SingleSelectInsertCombo="bi.single_select_insert_combo",t.Tab="bi.tab",t.Img="bi.img",t.BubbleCombo="bi.bubble_combo",t.VerticalAdapt="bi.vertical_adapt",t.HorizontalAdapt="bi.horizontal_adapt",t.Vtape="bi.vtape",t.CenterAdapt="bi.center_adapt",t.Htape="bi.htape",t.Layout="bi.layout",t.Absolute="bi.absolute",t.Vertical="bi.vertical",t.Horizontal="bi.horizontal",t.Left="bi.left",t.LeftRightVerticalAdapt="bi.left_right_vertical_adapt",t.VirtualGroup="bi.virtual_group",t.ListView="bi.list_view"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(7),s=i(8),r=i(9),a=i(11);i(24),t.className="designer.login.login",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login",width:420},_store:function(){return BI.Models.getModel(o["default"])},watch:{loading:function(e){this.loading.setVisible(e)}},render:function(){return{type:n.Vertical,cls:"designer-login",items:[{el:{type:n.HorizontalAdapt,items:[{type:s["default"],rgap:14,tgap:14}]}},{el:{type:n.Vertical,items:[{type:r["default"]},{type:a["default"]}]},lgap:15,rgap:15,bgap:15}]}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});BI.model("designer.login.login.model",BI.inherit(Fix.Model,{childContext:["loading"],state:function(){return{loading:!1}}})),t["default"]="designer.login.login.model"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(1);t.className="designer.login.login.close.button",t.Widget=BI.inherit(BI.Widget,{render:function(){return{type:n.TextButton,text:String.fromCharCode(10005),cls:"background-login-close",width:18.38,height:18.38,handler:function(){o["default"].closeWindow(!1)}}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0);i(10),t.className="designer.login.login.title",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-title"},render:function(){return{type:n.Label,text:BI.i18nText("Designer-Login_Title"),cls:"bi-font-bold",bgap:10}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(12);i(13);var s=i(14),r=i(16),a=i(18),l=i(2),u=i(1),g=249.64,c=331.64,d=422,f=478,p=560;t.className="designer.login.login.body",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(o["default"])},watch:{loginMethod:function(e){this.tabOption.setValue(e),this.tab.setSelect(e),this.foot.setLoginMethod(e),this.refreshLoginButton(),e===l.LOGIN.NORMAL_METHOD?(this.tab.setHeight(g),u["default"].resize(d,f)):this.model.expand&&(u["default"].resize(d,p),this.tab.setHeight(c))},approve:function(e){this.refreshLoginButton()},expand:function(e){e&&(u["default"].resize(d,p),this.tab.setHeight(c))}},render:function(){var e=this;return{type:n.Vertical,cls:"designer-login-body",items:[{type:n.ButtonGroup,value:this.model.loginMethod,ref:function(t){e.tabOption=t},layouts:[{type:n.HorizontalAdapt}],items:[{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.SMS_METHOD,text:BI.i18nText("Designer-Login_Sms")},{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.NORMAL_METHOD,text:BI.i18nText("Designer-Login_Normal")}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(t){e.store.setLoginMethod(t)}}],tgap:24,lgap:75,rgap:75},{type:n.CenterAdapt,tgap:35,items:[{type:n.Tab,cardCreator:BI.bind(this.createCard,this),showIndex:this.model.loginMethod,ref:function(t){e.tab=t},height:g,width:280}]},{type:s["default"],lgap:50,rgap:50,bgap:30,ref:function(t){e.foot=t},refreshStatus:function(t){e.store.setApprove(t)}}]}},mounted:function(){var e=u["default"].getParams(),t=e.designerLoginSource,i=e.lastLoginType;if("2"===t){var n="0"===i?l.LOGIN.NORMAL_METHOD:l.LOGIN.SMS_METHOD;this.store.setLoginMethod(n)}},createCard:function(e){var t=this;switch(e){case l.LOGIN.NORMAL_METHOD:return{type:r["default"],ref:function(e){t.normalMethod=e}};case l.LOGIN.SMS_METHOD:default:return{type:a["default"],ref:function(e){t.smsMethod=e},expand:function(){t.store.setExpand(!0)}}}},refreshLoginButton:function(){this.model.loginMethod===l.LOGIN.NORMAL_METHOD?this.normalMethod.setApprove(this.model.approve):this.smsMethod.setApprove(this.model.approve)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0;var n=i(2);t.className="designer.login.model.login.body",t.Model=BI.inherit(Fix.Model,{context:["loading"],state:function(){return{loginMethod:n.LOGIN.SMS_METHOD,approve:!0,expand:!1}},actions:{setLoginMethod:function(e){this.model.loginMethod=e},setApprove:function(e){this.model.approve=e},setExpand:function(e){this.model.expand=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(1),o=i(0);i(15);var s=i(2);t.className="designer.login.login.foot",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-foot"},render:function(){var e=this,t=this.options;return{type:o.LeftRightVerticalAdapt,items:{left:[{type:o.MultiSelectItem,width:30,selected:!0,handler:function(){t.refreshStatus(this.isSelected())}},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:BI.i18nText("Designer-Login_I_Have_Read")},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:"《"},{type:o.TextButton,cls:"login-link",textAlign:"left",text:BI.i18nText("Designer-Login_Service_Terms"),handler:function(){n["default"].serviceHref()}},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:"》"}],right:[{type:o.TextButton,cls:"login-link",textAlign:"right",text:BI.i18nText("Designer-Login_Forget_Password"),invisible:!0,ref:function(t){e.forgetPassword=t},handler:function(){n["default"].forgetHref()}}]}}},setLoginMethod:function(e){e===s.LOGIN.NORMAL_METHOD?this.forgetPassword.setVisible(!0):this.forgetPassword.setVisible(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(3),s=i(1),r=i(17),a=i(2);t.className="designer.login.login.normal",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(r["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)}},render:function(){var e=this;return{type:n.Vertical,items:[{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_User_Name"),bgap:3},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_User_Name_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.userName=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Hint"),inputType:"password",allowBlank:!0,height:40,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:10,ref:function(t){e.errMessage=t}},{type:n.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()}}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=s["default"].getParams(),i=t.designerLoginSource,n=t.lastLoginType,o=t.lastLoginAccount;"2"===i&&"0"===n&&e.userName.setValue(o)},checkUsername:function(){var e=this.userName.getValue();e&&this.userName.setValue(e.replace(/\s+/g,""))},login:function(){var e=this;e.checkUsername();var t=this.userName.getValue(),i=this.password.getValue();t?i?s["default"].normalLogin(t,i,(function(t){var i=parseInt(t,10);if(i>0)s["default"].closeWindow(!0);else{var n=o.getError(a.NORMAL_LOGIN_RESULT,i);n&&e.store.setErrMessage(BI.i18nText(n))}})):this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null")):this.store.setErrMessage(BI.i18nText("Designer-Login_Username_Not_Null"))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.normal_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:""}},actions:{setErrMessage:function(e){this.model.errMessage=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(19),s=i(21),r=i(22),a=i(2),l=i(23),u=i(1),g=i(3);t.className="designer.login.login.sms",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(l["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)},isRegister:function(e){var t=this.options;e&&(t.expand(),this.password.setVisible(!0),this.passwordLabel.setVisible(!0))}},render:function(){var e=this,t=this;return{type:n.Vertical,items:[{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Phone"),bgap:3},{type:n.HorizontalAdapt,bgap:7,items:[{type:o["default"],height:42,textFormatter:function(e){var i=t.getNumberTypeItem(e);return{value:i.value,text:BI.i18nText(i.text)}},value:a.REGION[0].value,items:BI.map(a.REGION,(function(e,t){return{type:s["default"],value:t.value,label:BI.i18nText(t.text),text:t.value}})),ref:function(t){e.regionCode=t}},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_Phone_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.phone=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Code"),bgap:3},{type:n.Horizontal,bgap:7,items:[{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Code_Hint"),inputType:"text",allowBlank:!0,height:40,width:190,ref:function(t){e.code=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:r["default"],height:40,width:90,ref:function(t){e.accountCaptcha=t},listeners:[{eventName:"EVENT_SEND",action:function(){t.sendCaptcha()}}]}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3,invisible:!0,ref:function(t){e.passwordLabel=t}},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Setting_Hint"),inputType:"password",allowBlank:!0,height:40,invisible:!0,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:11,ref:function(t){e.errMessage=t}},{type:n.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login_Register_Or_Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()}}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=u["default"].getParams(),i=t.designerLoginSource,n=t.lastLoginType,o=t.lastLoginAccount;if("2"===i&&"1"===n){var s=o.split("-")[0],r=o.split("-")[1];e.regionCode.setValue(s),e.phone.setValue(r)}},getNumberTypeItem:function(e){return BI.find(a.REGION,(function(t,i){return e===i.value}))||{}},checkPhone:function(){var e=this.phone.getValue();e&&this.phone.setValue(e.replace(/\s+/g,""))},login:function(){var e=this,t=this;t.checkPhone();var i=this.phone.getValue(),n=this.code.getValue();if(i)if(n){var o=this.regionCode.getValue();if(this.model.isRegister){var s=this.password.getValue();if(!s)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null"));var r=this.model.regToken;if(!r)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"));u["default"].smsRegister(o,i,s,r,(function(e){var i=parseInt(e,10);if(i>0)u["default"].closeWindow(!0);else{var n=g.getError(a.BBS_ERROR_CODE,i);n&&t.store.setErrMessage(BI.i18nText(n))}}))}else u["default"].smsLogin(o,i,n,(function(i){var n=JSON.parse(i);if(n.status>0)if(!0===n.register){var o=n.regtoken;o?(t.store.setRegister(!0),t.store.setRegToken(o)):e.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"))}else u["default"].closeWindow(!0);else{var s=g.getError(a.BBS_ERROR_CODE,n.status);s&&t.store.setErrMessage(BI.i18nText(s))}}))}else this.store.setErrMessage(BI.i18nText("Designer-Login_Code_Not_Null"));else this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"))},sendCaptcha:function(){var e=this;e.checkPhone();var t=this.phone.getValue();if(!t)return e.accountCaptcha.setButtonEnable(!0),void this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"));var i=this.regionCode.getValue();u["default"].sendCaptcha(i,t,(function(t){var i=parseInt(t,10);if(1===i)e.accountCaptcha.regainCaptcha();else{if(e.accountCaptcha.setButtonEnable(!0),0===i)return void e.store.setErrMessage(BI.i18nText("Designer-BBS_Please_Enter_Correct_Phone"));var n=g.getError(a.BBS_ERROR_CODE,i);n&&e.store.setErrMessage(BI.i18nText(n))}}))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(20);t.className="designer.left_right_text_value_combo",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,textFormatter:function(e){return e},value:""},render:function(){var e=this,t=this.options;return{type:"bi.combo",container:t.container,adjustLength:2,ref:function(t){e.combo=t},el:{type:n["default"],cls:"text-value-trigger",items:t.items,height:t.height-2,value:t.textFormatter(t.value),ref:function(t){e.trigger=t}},popup:{el:{type:"bi.text_value_combo_popup",chooseType:t.chooseType,value:t.value,items:t.items,ref:function(t){e.popup=t},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){e.setValue(e.getValue()),e.combo.hideView(),e.fireEvent("EVENT_CHANGE",arguments)}},{eventName:BI.Controller.EVENT_CHANGE,action:function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},value:t.value,maxHeight:240,minHeight:25}}},setValue:function(e){this.combo.setValue(e),this.trigger.setValue(this.options.textFormatter(e))},getValue:function(){var e=this.combo.getValue();return BI.isNull(e)?"":BI.isArray(e)?e[0]:e},populate:function(e){this.options.items=e,this.combo.populate(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.left_right_text_value_combo_trigger",t.Widget=BI.inherit(BI.Trigger,{props:{baseCls:"",value:{}},render:function(){var e=this,t=this.options,i=t.value;return{type:"bi.htape",cls:"bi-border-bottom bi-border-radius",items:[{type:"bi.label",text:i.text,title:function(){return e.textRow.getText()},height:t.height,hgap:3,textAlign:"left",ref:function(t){e.textRow=t}},{type:"bi.label",text:i.value,height:t.height,width:32,textAlign:"right",ref:function(t){e.valueRow=t}},{type:"bi.trigger_icon_button",width:t.triggerWidth||t.height}]}},setValue:function(e){this.textRow.setText(e.text),this.valueRow.setText(e.value)},setText:function(e){this.textRow.setText(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.components.phone.editor.item",t.Widget=BI.inherit(BI.BasicButton,{props:{baseCls:"designer-login-login-body",label:"",text:""},render:function(){var e=this.options;return{type:"bi.htape",items:[{el:{type:"bi.label",text:e.label,title:e.label,textAlign:"left"},lgap:10,rgap:5},{el:{type:"bi.label",text:e.text,textAlign:"right"},width:32,rgap:10}]}},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent("EVENT_CHANGE",this.isSelected(),this)},setSelected:function(e){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)},getValue:function(){return this.options.value}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0);t.className="designer.user.account.setting.captcha",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},render:function(){var e=this;this.options;return{type:n.TextButton,text:BI.i18nText("Designer-Login_Code_Request"),cls:"designer-login-border-bottom designer-login-code-text",handler:function(){e.setButtonEnable(!1),e.fireEvent("EVENT_SEND")},ref:function(t){e.getButton=t}}},setButtonEnable:function(e){this.captchaTime&&(e=!1),this.getButton.setEnable(e)},regainCaptcha:function(){var e=this,t=0;window.clearInterval(e.captchaTime),this.captchaTime=window.setInterval((function(){if(60===t)return window.clearInterval(e.captchaTime),e.captchaTime=null,e.getButton.setText(BI.i18nText("Designer-Login_Code_Request")),void e.setButtonEnable(!0);e.getButton.setText(BI.i18nText("Designer-Login_Code_Request_Again")+"("+(60-t)+")"),t++}),1e3),this.setButtonEnable(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.sms_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:"",isRegister:!1,regToken:""}},actions:{setErrMessage:function(e){this.model.errMessage=e},setRegister:function(e){this.model.isRegister=e},setRegToken:function(e){this.model.regToken=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){}]); \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 4e25381e1f..29180c09db 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -14,14 +14,12 @@ import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; -import com.fr.design.upm.event.CertificateEvent; +import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; @@ -31,17 +29,14 @@ import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; -import java.awt.Color; import javax.swing.SwingConstants; import java.awt.Cursor; -import java.awt.Desktop; import java.awt.Frame; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.UnsupportedEncodingException; import java.lang.reflect.Constructor; import java.lang.reflect.Method; -import java.net.URI; import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.Date; @@ -80,12 +75,16 @@ public class UserInfoLabel extends UILabel { @Override public void mouseEntered(MouseEvent e) { UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); - UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); + if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); + } } @Override public void mouseExited(MouseEvent e) { - UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); + if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); + } } @Override @@ -104,7 +103,8 @@ public class UserInfoLabel extends UILabel { if (StringUtils.isNotEmpty(userName)) { try { LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); - Desktop.getDesktop().browse(new URI(spaceMark.getValue())); + String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(spaceMark.getValue()); + BrowseUtils.browser(ssoUrl); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } @@ -211,12 +211,6 @@ public class UserInfoLabel extends UILabel { DesignerLoginHelper.showLoginDialog(source); } }); - EventDispatcher.listen(CertificateEvent.LOGIN, new Listener() { - @Override - public void on(Event event, String text) { - setText(text); - } - }); } private void clearLoginInformation() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java index 1e3df83df4..e6ae079aa4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -9,6 +9,10 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.upm.event.CertificateEvent; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; import com.fr.general.DateUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -75,6 +79,13 @@ public class UserInfoPane extends BasicPane { autoPushLoginDialog(); this.add(userInfoLabel, BorderLayout.CENTER); + + EventDispatcher.listen(CertificateEvent.LOGIN, new Listener() { + @Override + public void on(Event event, String text) { + markSignIn(text); + } + }); } public UserInfoLabel getUserInfoLabel() { diff --git a/designer-realize/src/main/java/com/fr/design/share/SharableManager.java b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java index 05f893fadd..0e3a1c41e8 100644 --- a/designer-realize/src/main/java/com/fr/design/share/SharableManager.java +++ b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java @@ -9,15 +9,21 @@ import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.collect.SharableCollectorManager; import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; +import com.fr.design.mainframe.share.ui.block.LocalWidgetBlock; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.design.share.utils.EffectItemUtils; +import com.fr.form.share.ShareLoader; +import com.fr.general.GeneralContext; import com.fr.json.JSONArray; +import com.fr.stable.EnvChangedListener; import java.util.List; public class SharableManager { public static void start() { SharableCollectorManager.getInstance().execute(); + listenEnv(); ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); } @@ -44,4 +50,13 @@ public class SharableManager { } } } + + private static void listenEnv() { + GeneralContext.addEnvChangedListenerToLast(new EnvChangedListener() { + @Override + public void envChanged() { + LocalWidgetRepoPane.getInstance().refreshPane(); + } + }); + } } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 341042ec20..eaba1f0467 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -122,6 +122,7 @@ import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.start.BBSGuestPaneProvider; import com.fr.task.Once; +import com.fr.workspace.WorkContext; import com.fr.xml.ReportXMLUtils; import java.util.ArrayList; @@ -435,6 +436,9 @@ public class DesignerActivator extends Activator implements Prepare { } private void migrateBBSInfoFromFineDB() { + if (!WorkContext.getCurrent().isLocal()) { + return; + } DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); if (manager.isCurrentVersionFirstLaunch()) { int newUid = manager.getDesignerLoginUid();