| | |
| | | package com.ruoyi.auth.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A; |
| | | import com.ruoyi.auth.config.QywxInnerConfig; |
| | | import com.ruoyi.auth.utils.RestUtils; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.api.model.AgentConfigVo; |
| | | import org.apache.commons.codec.binary.Hex; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.cache.RedisCache; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.Calendar; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service |
| | |
| | | } |
| | | logger.info("----------------userinfo detail -------------"); |
| | | logger.info(detailResponse.toString()); |
| | | |
| | | return detailResponse; |
| | | } |
| | | |
| | |
| | | String ticketKey = Constants.QY_WX_TICKET_KEY; |
| | | |
| | | String jsapiTicketUrl = qywxInnerConfig.getJsapiTicketUrl(); |
| | | if(!StringUtils.isEmpty(type)){ |
| | | if("agent_config".equals(type)){ |
| | | ticketKey = ticketKey + type; |
| | | jsapiTicketUrl = qywxInnerConfig.getJsapiTicketAgentUrl(); |
| | | } |
| | |
| | | ticket = response.getString(Constants.QY_WX_TICKET); |
| | | Long expiresIn = response.getLong(Constants.QY_WX_EXPIRES_IN); |
| | | expiresIn = expiresIn - 100; |
| | | redisTemplate.opsForValue().set(Constants.QY_WX_TICKET_KEY, ticket, expiresIn, TimeUnit.SECONDS); |
| | | redisTemplate.opsForValue().set(ticketKey, ticket, expiresIn, TimeUnit.SECONDS); |
| | | |
| | | return ticket; |
| | | } |