|
|
|
@ -3,7 +3,10 @@ package com.fr.design.login;
|
|
|
|
|
import com.fr.design.bridge.exec.JSBridge; |
|
|
|
|
import com.fr.design.bridge.exec.JSCallback; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.gui.ilable.ActionLabel; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.locale.impl.BbsResetMark; |
|
|
|
|
import com.fr.design.login.executor.DesignerLoginBrowserExecutor; |
|
|
|
|
import com.fr.design.login.executor.DesignerLoginExecutor; |
|
|
|
@ -11,6 +14,7 @@ import com.fr.design.login.executor.DesignerSendCaptchaExecutor;
|
|
|
|
|
import com.fr.design.login.executor.DesignerSmsLoginExecutor; |
|
|
|
|
import com.fr.design.login.executor.DesignerSmsRegisterExecutor; |
|
|
|
|
import com.fr.design.login.task.DesignerLoginTaskWorker; |
|
|
|
|
import com.fr.design.mainframe.toast.DesignerToastMsgUtil; |
|
|
|
|
import com.fr.design.utils.BrowseUtils; |
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
import com.fr.general.locale.LocaleCenter; |
|
|
|
@ -20,10 +24,13 @@ import com.teamdev.jxbrowser.chromium.Browser;
|
|
|
|
|
import com.teamdev.jxbrowser.chromium.JSFunction; |
|
|
|
|
import com.teamdev.jxbrowser.chromium.JSObject; |
|
|
|
|
import java.awt.Desktop; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.net.URI; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Set; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -59,7 +66,15 @@ public class DesignerLoginBridge {
|
|
|
|
|
public void closeWindow(boolean loginSuccess) { |
|
|
|
|
DesignerLoginSource source = DesignerLoginSource.valueOf(Integer.parseInt(params.get("designerLoginSource"))); |
|
|
|
|
if (loginSuccess) { |
|
|
|
|
if (source == DesignerLoginSource.BBS_JUMP) { |
|
|
|
|
if (source == DesignerLoginSource.GUIDE) { |
|
|
|
|
DesignerToastMsgUtil.toastPrompt( |
|
|
|
|
getHyperlinkPane( |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Title"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Hyperlink_Text"), |
|
|
|
|
CloudCenter.getInstance().acquireUrlByKind("designer.premium.template", "https://market.fanruan.com/template") |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} else if (source == DesignerLoginSource.BBS_JUMP) { |
|
|
|
|
String bbsJumpUrl = params.get("bbsJumpUrl"); |
|
|
|
|
BrowseUtils.browser(bbsJumpUrl); |
|
|
|
|
} |
|
|
|
@ -245,4 +260,21 @@ public class DesignerLoginBridge {
|
|
|
|
|
public void resize(int width, int height) { |
|
|
|
|
DesignerLoginHelper.getDialog().setSize(width, height); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel getHyperlinkPane(String title, String hyperlinkText, String hyperlink) { |
|
|
|
|
ActionLabel actionLabel = new ActionLabel(hyperlinkText); |
|
|
|
|
actionLabel.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
try { |
|
|
|
|
Desktop.getDesktop().browse(new URI(hyperlink)); |
|
|
|
|
} catch (Exception ignore) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
panel.add(new UILabel(title)); |
|
|
|
|
panel.add(actionLabel); |
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|