liujie
8 天以前 ba0750bfb9ec465eeab979f29e9b2ef742c46af0
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -559,7 +559,7 @@
            }
            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();
@@ -568,10 +568,13 @@
            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));