diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index f7597d383d..ecaa34ea00 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -48,10 +48,7 @@ public class PluginHelper { * @param p 下载百分比处理 */ public static void downloadPluginFile(String id, String username, String password, Process p) throws Exception { - if (StringUtils.isEmpty(id)) { - return; - } - if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) { + if (!PluginHelper.invalidUser(id, username, password)) { return; } HttpClient httpClient = new HttpClient(getDownloadPath(id, username, password)); @@ -79,6 +76,16 @@ public class PluginHelper { } } + private static boolean invalidUser(String id, String username, String password) { + if (StringUtils.isEmpty(id)) { + return false; + } else if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){ + return false; + } else { + return true; + } + } + private static String getDownloadPath(String id, String username, String password) throws Exception { HashMap map = new HashMap(); map.put("id", id);