| | |
| | | System.out.println(ivc.getText()+"----加密前的验证码"); |
| | | // System.out.println(MD5Util.md5(ivc.getText().toUpperCase())+"----加密后的验证码"); |
| | | RedisUtils.getBean().set(key+"",MD5Util.md5(ivc.getText().toUpperCase()),60); |
| | | // request.getSession().setAttribute(key+"", MD5Util.md5(ivc.getText().toUpperCase())); //将验证码的文本存在session中 |
| | | request.getSession().setAttribute(key+"", MD5Util.md5(ivc.getText().toUpperCase())); //将验证码的文本存在session中 |
| | | // ImageVerificationCode.output(image, response.getOutputStream());//将验证码图片响应给客户端 |
| | | String img = getBufferedImageToBase64(image, "JPEG"); |
| | | // String session_vcode = (String) request.getSession().getAttribute(key+""); |
| | | String session_vcode = (String) request.getSession().getAttribute(key+""); |
| | | |
| | | |
| | | Map map = new HashMap(); |
| | | map.put("img", img); |
| | | // map.put("vlue", session_vcode); |
| | | map.put("vlue", session_vcode); |
| | | map.put("key", key); |
| | | return map; |
| | | } |