| | |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | String accessToken=null; |
| | | Object img = redisTemplate.opsForValue().get("dache:DRIVER_WX_IMG" + uid); |
| | | Object img = redisTemplate.opsForValue().get("DRIVER_WX_IMG" + uid); |
| | | // 获取调用凭证accessToken |
| | | if(ToolUtil.isEmpty(driver.getShareLink())|| ToolUtil.isEmpty(img)){ |
| | | accessToken = getAccessToken(); |
| | |
| | | |
| | | if(ToolUtil.isEmpty(img)) { |
| | | RestTemplate rest = new RestTemplate(); |
| | | String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken; |
| | | // String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken; |
| | | String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("path", "pages/home/home?driverId=" + uid); |
| | | param.put("page", "pages/home/home"); |
| | | param.put("width", 430); //二维码尺寸 |
| | | param.put("scene", "driverId=" + uid); //二维码尺寸 |
| | | param.put("env_version", "trial"); //二维码尺寸 |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.body(JSON.toJSONString(param)); |
| | | |