微信获取二维码

微信获取二维码

String listUrl = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token="+accessToken;
        // {"action_name": "QR_LIMIT_STR_SCENE", "action_info": {"scene": {"scene_str": "123"}}}
        Map<String, Object> request = new HashMap<String, Object>();
        request.put("action_name", "QR_LIMIT_STR_SCENE");
        Map<String, Object> actionInfoMap = new HashMap<String, Object>();
        Map<String, String> sceneMap = new HashMap<String, String>();
        sceneMap.put("scene_str", qrid);
        actionInfoMap.put("scene", sceneMap);
        request.put("action_info", actionInfoMap);
        @SuppressWarnings("unchecked")
        Map<String,String> postMap = template.postForObject(listUrl, request, Map.class);
        if(postMap == null){
            return "";
        }
        String url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=";
        return url + postMap.get("ticket");

 

微信获取二维码

上一篇:微信自定义菜单


下一篇:UC和QQ两个主流浏览器 * 点击触发微信分享到朋友圈或发送给朋友的功能(转载)