From 28ba72b1ebc7a4001ead6701e42a6dfaa572af68 Mon Sep 17 00:00:00 2001 From: lilin Date: Mon, 29 Apr 2019 16:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A6=82=E6=9E=9C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=B2=A1=E6=9C=89=E5=88=9B=E5=BB=BA=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=97=B6=E7=BB=99=E7=94=A8=E6=88=B7=E6=8E=88=E6=9D=83=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E4=BC=9A=E6=8A=A5=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/escheduler/api/service/ResourcesService.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/escheduler-api/src/main/java/cn/escheduler/api/service/ResourcesService.java b/escheduler-api/src/main/java/cn/escheduler/api/service/ResourcesService.java index e0ab90185d..291c59ea22 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/service/ResourcesService.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/service/ResourcesService.java @@ -701,17 +701,19 @@ public class ResourcesService extends BaseService { if (checkAdmin(loginUser, result)) { return result; } - List resourceList = resourcesMapper.queryResourceExceptUserId(userId); - Set resourceSet = null; + List list ; if (resourceList != null && resourceList.size() > 0) { - resourceSet = new HashSet<>(resourceList); - + Set resourceSet = new HashSet<>(resourceList); List authedResourceList = resourcesMapper.queryAuthorizedResourceList(userId); getAuthorizedResourceList(resourceSet, authedResourceList); + list = new ArrayList<>(resourceSet); + }else { + list = new ArrayList<>(0); } - result.put(Constants.DATA_LIST, new ArrayList<>(resourceSet)); + + result.put(Constants.DATA_LIST, list); putMsg(result,Status.SUCCESS); return result; }