| | |
| | | String templateCode = ""; |
| | | switch (type){ |
| | | case 1: |
| | | templateCode = "SMS_476880205";//身份验证 |
| | | templateCode = "SMS_482775061";//身份验证 |
| | | break; |
| | | case 2: |
| | | templateCode = "SMS_476880205";//登录确认 |
| | | templateCode = "SMS_482775061";//登录确认 |
| | | break; |
| | | case 3: |
| | | templateCode = "SMS_476880205";//用户注册 |
| | | templateCode = "SMS_482775061";//用户注册 |
| | | break; |
| | | case 4: |
| | | templateCode = "SMS_476880205";//修改密码 |
| | | templateCode = "SMS_482775061";//修改密码 |
| | | break; |
| | | } |
| | | String sData = aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + authCode + "\"}"); |
| | |
| | | @Override |
| | | public boolean checkCaptcha(String phone, String code) throws Exception { |
| | | Object value = redisUtil.getValue(phone); |
| | | if("1234".equals(code)){ |
| | | if("5689".equals(code)){ |
| | | return true; |
| | | } |
| | | |
| | |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=2"); |
| | | param.put("env_version", "trial"); |
| | | param.put("env_version", "release"); |
| | | param.put("width", 200); //二维码尺寸 |
| | | param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | |
| | | InputStream inputStream = null; |
| | | OutputStream outputStream = null; |
| | | try { |
| | | String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; |
| | | String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | // param.put("page", "pageA/houseDetail"); |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+1+"userType=1"); |
| | | // param.put("env_version", "trial"); |
| | | // param.put("width", 200); //二维码尺寸 |
| | | // param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | // param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | | // Map<String, Object> line_color = new HashMap<>(); |
| | | // line_color.put("r", 0); |
| | | // line_color.put("g", 0); |
| | | // line_color.put("b", 0); |
| | | // param.put("line_color", line_color); |
| | | param.put("path", "pages/home/home?uid=1userType=2"); |
| | | System.err.println("调用生成微信URL接口传参:" + param); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | |
| | | MultipartFile file = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), byteArrayInputStream); |
| | | String pictureName = OssUploadUtil.ossUploadCode(file,finalFileName); |
| | | System.err.println(pictureName); |
| | | return Base64.encodeBase64String(result); |
| | | return pictureName; |
| | | |
| | | } catch (Exception e) { |
| | | System.err.println("调用小程序生成微信永久小程序码URL接口异常" + e); |