diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index 079a393e5d..549cb17632 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -327,6 +327,7 @@ public class LoginWebBridge { DesignerEnvManager.getEnvManager().setBBSName(username); DesignerEnvManager.getEnvManager().setBbsUid(uid); DesignerEnvManager.getEnvManager().setInShowBBsName(username); + BBSPluginLogin.getInstance().login(new BBSUserInfo(username, "")); } else if (status.equals(LOGIN_FAILED)) { //账号没有QQ授权 closeQQWindow(); diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java index a2a30c7483..7f64bcec46 100644 --- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java @@ -509,6 +509,13 @@ public class PluginWebBridge { LoginWebBridge.getHelper().showQQ(); } + //通过QQ登录后通知登录 + public void ucsynLogin(long uid, String username){ + BBSUserInfo bbsUserInfo = new BBSUserInfo(username, ""); + BBSPluginLogin.getInstance().login(bbsUserInfo); + uiLabel.setText(username); + } + /** * 清除用户信息 */ diff --git a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java index 3af2b5d439..84ecb10c38 100644 --- a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -80,21 +80,29 @@ public class WebViewDlgHelper { public static void checkAndCopyMainFile(String indexPath, String mainJsPath){ File file = new File(indexPath); if (!file.exists()) { - try { - File mainJsFile = new File(mainJsPath); - int byteread = 0; - if (mainJsFile.exists()) { - InputStream inStream = new FileInputStream(mainJsPath); - FileOutputStream fs = new FileOutputStream(indexPath); - byte[] buffer = new byte[BYTES_NUM]; - while ((byteread = inStream.read(buffer)) != -1) { - fs.write(buffer, 0, byteread); - } - inStream.close(); + copyMainFile(indexPath, mainJsPath); + } + } + + /** + * 將script文件夹中的index.html文件复制到webreport下 + * + */ + public static void copyMainFile(String indexPath, String mainJsPath){ + try { + File mainJsFile = new File(mainJsPath); + int byteread = 0; + if (mainJsFile.exists()) { + InputStream inStream = new FileInputStream(mainJsPath); + FileOutputStream fs = new FileOutputStream(indexPath); + byte[] buffer = new byte[BYTES_NUM]; + while ((byteread = inStream.read(buffer)) != -1) { + fs.write(buffer, 0, byteread); } - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage()); + inStream.close(); } + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); } } @@ -186,7 +194,9 @@ public class WebViewDlgHelper { try { if (get()) { + String relativePath = "/scripts/store/web/index.html"; IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); + copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath)); // TODO: 2017/4/17 删除之前存放在安装目录下的script int rv = JOptionPane.showOptionDialog( null,