登录图片验证码
页面刷新时,自动发送获取验证码到服务端
输入验证码登录,登录成功返回token
通过token获取用户详情,跳转主页
//获取验证码图片
@GetMapping("/verification")
public void verification(String uuid, HttpServletResponse response) throws IOException {
//1、生成验证码对象
LineCaptcha captcha = CaptchaUtil.createLineCaptcha(299, 97);
生成图片的宽和高
//2、验证码存入Redis
String code = captcha.getCode();
redisTemplate.opsForValue().set(Constants.CAP_CODE+uuid,code);
//3、输出验证码图片
captcha.write(response.getOutputStream());
}