| | |
| | | agentProducer.sendMemberSubMsg(fromUserName); |
| | | } else if ("unsubscribe".equals(eventType)) { |
| | | log.info("取消关注事件:toUserName{}、fromUserName{}", toUserName, fromUserName); |
| | | }else if ("SCAN".equals(eventType)) { |
| | | log.info("扫码关注事件:toUserName{}、fromUserName{}", toUserName, fromUserName); |
| | | if(map.containsKey("EventKey")){ |
| | | StringBuffer stringBuffer = new StringBuffer(); |
| | | /** |
| | | * 扫带参数二维码 |
| | | */ |
| | | String eventKey = map.get("EventKey"); |
| | | if(StrUtil.isNotEmpty(eventKey)){ |
| | | stringBuffer.append(eventKey); |
| | | stringBuffer.append("@"); |
| | | stringBuffer.append(fromUserName); |
| | | agentProducer.sendMemberSubScanMsg(stringBuffer.toString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | |
| | | String ticket = null; |
| | | // 拼接请求地址 |
| | | String CREATE_QRCODE_URL = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN"; |
| | | String requestUrl = CREATE_QRCODE_URL.replace("TOKEN", "70_ECdQaX-QtNXZP9ugU_JEJGRYEADWrlQZNYrT2I2IRHsx6hx4_O8RY4VasWI97_ixia8vANTdnNRI_cT00toK7CX98513sQI8535eTFw3b-VQChEFZrRqTfNPdSoGYXgAIAVNM"); |
| | | // String requestUrl = CREATE_QRCODE_URL.replace("TOKEN", redisUtils.get(WechatConfigure.WX_ACCESS_TOKEN_REDIS_KEY).toString()); |
| | | // String requestUrl = CREATE_QRCODE_URL.replace("TOKEN", "70_ECdQaX-QtNXZP9ugU_JEJGRYEADWrlQZNYrT2I2IRHsx6hx4_O8RY4VasWI97_ixia8vANTdnNRI_cT00toK7CX98513sQI8535eTFw3b-VQChEFZrRqTfNPdSoGYXgAIAVNM"); |
| | | String requestUrl = CREATE_QRCODE_URL.replace("TOKEN", redisUtils.get(WechatConfigure.WX_ACCESS_TOKEN_REDIS_KEY).toString()); |
| | | // 创建临时带参二维码 |
| | | |
| | | JSONObject jsonObject = restTemplate.postForObject(requestUrl, |
| | |
| | | * @return |
| | | */ |
| | | //图片上传路径 |
| | | public static final String IMG_UPLOAD_PATH="/home/javaweb/webresource/ywg/wxcode"; |
| | | public static final String IMG_UPLOAD_PATH="/home/javaweb/webresource/ywg/h5/wxcode"; |
| | | public String getQRcode(String ticket) { |
| | | |
| | | String SHOW_QRCODE_URL = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=TICKET"; |
| | |
| | | |
| | | String randomNum = MallUtils.getRandomNum(5); |
| | | String imgName="/user_" + randomNum + "_acode_1.jpg"; |
| | | String urlPrefix="https://ywgpzapi.meiao.biz/ywg/wxcode"; |
| | | String urlPrefix="https://ywgouth.meiao.biz/wxcode"; |
| | | String imgPath=IMG_UPLOAD_PATH+imgName; |
| | | if(!FileUtil.exist(imgPath)){ |
| | | try { |