|
@@ -48,8 +48,8 @@ public class DingUtil {
|
|
|
* 获取第三方应用授权企业的accessToken
|
|
|
* https://open.dingtalk.com/document/isvapp/obtain-the-access_token-of-the-authorized-enterprise
|
|
|
*/
|
|
|
- public static String getCorpAccessToken(String corpId) {
|
|
|
-
|
|
|
+ public static String getCorpAccessToken() {
|
|
|
+ String corpId = "ding53d823e205604918a39a90f97fcb1e09";
|
|
|
String redisKey = corpAccessTokenRedisKey + corpId;
|
|
|
String corpAccessToken = redisCache.getCacheObject(redisKey);
|
|
|
if (StrUtil.isNotBlank(corpAccessToken)) {
|
|
@@ -58,7 +58,7 @@ public class DingUtil {
|
|
|
|
|
|
SuiteTicketInfo suiteTicketInfo = suiteTicketInfoService.getOne(q -> q.eq(SuiteTicketInfo::getCorpId, corpId));
|
|
|
|
|
|
- if (suiteTicketInfo == null){
|
|
|
+ if (suiteTicketInfo == null) {
|
|
|
throw new ServiceException("没有找到对应的corp_id");
|
|
|
}
|
|
|
|
|
@@ -120,7 +120,7 @@ public class DingUtil {
|
|
|
OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest();
|
|
|
req.setDeptId(deptId);
|
|
|
req.setLanguage("zh_CN");
|
|
|
- OapiV2DepartmentListsubResponse rsp = client.execute(req, getCorpAccessToken(corpId));
|
|
|
+ OapiV2DepartmentListsubResponse rsp = client.execute(req, getCorpAccessToken());
|
|
|
return rsp.getResult();
|
|
|
} catch (Exception e) {
|
|
|
log.error("获取用户部门失败", e);
|