| | |
| | | @Autowired |
| | | private ThirdAppDingtalkServiceImpl thirdAppDingtalkService; |
| | | |
| | | /**token有效时间,目前现场要求企业微信有效时间*/ |
| | | public static final long EXPIRE_TIME = 30L * 24 * 60 * 60 * 1000; |
| | | |
| | | @RequestMapping("/render/{source}") |
| | | public void render(@PathVariable("source") String source, HttpServletResponse response) throws IOException { |
| | | log.info("第三方登录进入render:" + source); |
| | |
| | | String token = JwtUtil.sign(user.getUsername(), user.getPassword()); |
| | | redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token); |
| | | // 设置超时时间 |
| | | redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000); |
| | | redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, EXPIRE_TIME / 1000); |
| | | return token; |
| | | } |
| | | |
| | |
| | | // 企业的CorpID |
| | | builder.append("?appid=").append(config.getClientId()); |
| | | // 授权后重定向的回调链接地址,请使用urlencode对链接进行处理 |
| | | String redirectUri ="http://houjie.xalxzn.com:8866/jeecg-boot/sys/thirdLogin/oauth2/wechat_enterprise/callback"; |
| | | String redirectUri ="https://fastwoke.cn:8087/jeecg-boot/sys/thirdLogin/oauth2/wechat_enterprise/callback"; |
| | | builder.append("&redirect_uri=").append(URLEncoder.encode(redirectUri, "UTF-8")); |
| | | // 返回类型,此时固定为:code |
| | | builder.append("&response_type=code"); |