From a1d72bb047f93f95342e00a328b60561abde0218 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Mon, 21 Nov 2016 14:01:43 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-809=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E7=82=B9=E5=87=BB=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E6=9B=B4=E6=96=B0=E4=BC=9A=E6=8F=90=E7=A4=BA=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=BA=94=E7=94=A8=E5=95=86=E5=BA=97=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/extra/PluginHelper.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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);