|
|
@@ -89,13 +89,11 @@ public abstract class BaseSdk {
|
|
|
protected synchronized String getAccessToken(String agentCode) {
|
|
|
Agent agent = getAgentMap().get(agentCode);
|
|
|
if (null == agent) {
|
|
|
- //企业微信待开发应用无法通过审批及打卡应用获取,统一通过Uas应用获取
|
|
|
- if(agentCode.equals(CHECKIN_AGENT_CODE) || agentCode.equals(APPROVAL_AGENT_CODE)) {
|
|
|
- agent = getAgentMap().get(DEFAULT_AGENT_CODE);
|
|
|
- }
|
|
|
- if (null == agent) {
|
|
|
- throw new RuntimeException("没有找到应用" + agentCode);
|
|
|
- }
|
|
|
+ throw new RuntimeException("没有找到应用" + agentCode);
|
|
|
+ }
|
|
|
+ //企业微信待开发应用无法通过审批及打卡应用获取,统一通过Uas应用获取
|
|
|
+ if((agentCode.equals(CHECKIN_AGENT_CODE) || agentCode.equals(APPROVAL_AGENT_CODE)) && agent.getSecret().equals(DEFAULT_AGENT_CODE) ){
|
|
|
+ agent = getAgentMap().get(DEFAULT_AGENT_CODE);
|
|
|
}
|
|
|
if (!accessTokenMap.containsKey(agent.getSecret()) || accessTokenMap.get(agent.getSecret()).expired()) {
|
|
|
ResponseEntity<GetAccessTokenResp> resp = restTemplate.getForEntity(
|