提交 cafda352 编写于 作者: zhouweidong's avatar zhouweidong

token缓存改造

上级 c7da529a
......@@ -61,6 +61,8 @@ public class UserDingtalkRegisterService {
if((sysOpenAccess==null|| (sysOpenAccess.getDisabled()!=null && sysOpenAccess.getDisabled()==1))&&throwEx)
throw new BadRequestAlertException("获取接入配置失败","UserDingtalkRegisterService","");
String accessToken =dingTalkTokenService.getAccessToken(sysOpenAccess.getAccessKey(),sysOpenAccess.getSecretKey());
sysOpenAccess.setAccessToken(accessToken);
return sysOpenAccess;
}
......@@ -76,8 +78,7 @@ public class UserDingtalkRegisterService {
request.setHttpMethod("GET");
OapiUserGetuserinfoResponse response = null;
try {
String accessToken =dingTalkTokenService.getAccessToken(openAccess.getAccessKey(),openAccess.getSecretKey());
response = client.execute(request, accessToken);
response = client.execute(request, openAccess.getAccessToken());
if(response.getErrcode()!=0||StringUtils.isEmpty(response.getUserid()))
throw new BadRequestAlertException("获取user失败","UserDingtalkRegisterService",response.getErrmsg());
} catch (ApiException e) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册