| | |
| | | * @date 2017-05-05 23:10 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/kaptcha") |
| | | @RequestMapping("/base/kaptcha") |
| | | public class KaptchaController { |
| | | |
| | | @Autowired |
| | |
| | | */ |
| | | @RequestMapping("") |
| | | public void index(HttpServletRequest request, HttpServletResponse response,String phone) { |
| | | // String substring = phone.substring(0, 1); |
| | | // if("0".equals(substring)){ |
| | | // phone = "233" + phone.substring(1); |
| | | // } |
| | | // if(phone.indexOf("233") < 0){ |
| | | // phone = "233" + phone; |
| | | // } |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | |
| | | HttpSession session = request.getSession(); |
| | | |
| | |
| | | |
| | | // store the text in the session |
| | | session.setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); |
| | | // redisUtil.setStrValue(phone+"_Code",capText); |
| | | redisUtil.setStrValue(phone+"_Code",capText); |
| | | |
| | | // create the image with the text |
| | | Properties properties = new Properties(); |