首页 > 微信 > 详细

微信获取二维码

时间:2017-03-22 00:20:55      阅读:271      评论:0      收藏:0      [点我收藏+]

微信获取二维码

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");

 

微信获取二维码

原文:http://www.cnblogs.com/stono/p/6597504.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!