| | |
| | | httpHeaders.add("Authorization", "Bearer " |
| | | + getAccessToken(MappingCache.getValue(DING_DING_DOMAIN, DING_DING_APP_ID), |
| | | MappingCache.getValue(DING_DING_DOMAIN, DING_DING_APP_SECURE))); |
| | | httpHeaders.add("Content-Type","application/json"); |
| | | HttpEntity httpEntity = new HttpEntity(body, httpHeaders); |
| | | ResponseEntity<String> response = null; |
| | | try { |
| | |
| | | String accessToken = responseObj.getString("token"); |
| | | long expiresIn = responseObj.getLongValue("expireTime"); |
| | | timestamp = DateUtil.getCurrentDate().getTime(); |
| | | JWTCache.setValue(DING_DING_CHARGE_MACHINE + appId, accessToken, (int) (expiresIn - timestamp - 200)); |
| | | JWTCache.setValue(DING_DING_CHARGE_MACHINE + appId, accessToken, (int) ((expiresIn - timestamp)/1000 - 200)); |
| | | return accessToken; |
| | | } |
| | | return ""; |