1.pom.xml
<!-- 图形验证码-->
<dependency>
<groupId>com.github.whvcse</groupId>
<artifactId>easy-captcha</artifactId>
<version>1.6.2</version>
</dependency>
2.controller层
@Controller
public class CaptchaController {
@RequestMapping("/captcha")
public void captcha(HttpServletRequest request, HttpServletResponse response) throws Exception {
CaptchaUtil.out(request, response);
}
}
3.前端使用
<img src="/LwxWeb/captcha" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode">
标签:request,response,captcha,easy,使用,public
From: https://www.cnblogs.com/lwx11111/p/17139498.html