diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index 4a4870ba23..ecaa34ea00 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -15,6 +15,7 @@ import com.fr.plugin.dependence.PluginDependenceUnit; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLTools; @@ -47,6 +48,9 @@ public class PluginHelper { * @param p 下载百分比处理 */ public static void downloadPluginFile(String id, String username, String password, Process p) throws Exception { + if (!PluginHelper.invalidUser(id, username, password)) { + return; + } HttpClient httpClient = new HttpClient(getDownloadPath(id, username, password)); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { int totalSize = httpClient.getContentLength(); @@ -72,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);