From 8d01683ba08ee6c9c16de3ecc3206cafca7e21e6 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Tue, 10 Nov 2020 13:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/department/impl/DepartmentServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java index c3d7652..9af318b 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java @@ -36,6 +36,7 @@ public class DepartmentServiceImpl extends AbstractService implements IDepartmen @Override public JSONArray listDepartments(Map params) throws AccessTokenException, SearchException { + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_DEPARTMENT, apiPathProperties.getUserCenter(), params.get("parentId").toString()), params); if (result == null) { throw new AccessTokenException("认证失败"); @@ -48,7 +49,9 @@ public class DepartmentServiceImpl extends AbstractService implements IDepartmen @Override public JSONArray listDepartmentsAllByParentId(String parentId) throws AccessTokenException, SearchException { - String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_ALL_DEPARTMENT, apiPathProperties.getUserCenter(), parentId), new HashMap<>(0)); + Map params = getHashMap(2); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_ALL_DEPARTMENT, apiPathProperties.getUserCenter(), parentId), params); if (result == null) { throw new AccessTokenException("认证失败"); } @@ -60,7 +63,7 @@ public class DepartmentServiceImpl extends AbstractService implements IDepartmen @Override public JSONArray listZTreeDepartmentWithUser(String departmentParentId) throws AccessTokenException, SearchException { - Map params = new HashMap<>(1); + Map params = new HashMap<>(2); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); params.put("id", departmentParentId); String result = restTemplateUtil.doGetFormNormal(String.format(IApiConsts.LIST_ZTREE_DEPARTMENT_WITH_USER, apiPathProperties.getUserCenter()), params);