easy-captcha使用

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">
posted @ 2023-02-21 00:18  lwx_R  阅读(125)  评论(0编辑  收藏  举报