处理Oauth的session问题

This commit is contained in:
wenc000 2020-11-11 17:57:10 +08:00
parent 8d01683ba0
commit bae4016a7b

View File

@ -37,7 +37,7 @@ public class DepartmentServiceImpl extends AbstractService implements IDepartmen
@Override @Override
public JSONArray listDepartments(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listDepartments(Map<String, Object> params) throws AccessTokenException, SearchException {
params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); 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); String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_DEPARTMENT, apiPathProperties.getUserCenter(), params.get("parentId").toString()), params);
if (result == null) { if (result == null) {
throw new AccessTokenException("认证失败"); throw new AccessTokenException("认证失败");
} }
@ -51,7 +51,7 @@ public class DepartmentServiceImpl extends AbstractService implements IDepartmen
public JSONArray listDepartmentsAllByParentId(String parentId) throws AccessTokenException, SearchException { public JSONArray listDepartmentsAllByParentId(String parentId) throws AccessTokenException, SearchException {
Map<String, Object> params = getHashMap(2); Map<String, Object> params = getHashMap(2);
params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_ALL_DEPARTMENT, apiPathProperties.getUserCenter(), parentId), params); String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_ALL_DEPARTMENT, apiPathProperties.getUserCenter(), parentId), params);
if (result == null) { if (result == null) {
throw new AccessTokenException("认证失败"); throw new AccessTokenException("认证失败");
} }