From ecc4e57b4f7c6ecfd6823704688ee786b3350b1f Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期一, 02 十二月 2024 11:06:13 +0800 Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0 --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/KaptchaController.java | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/KaptchaController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/KaptchaController.java index 2110f79..a2efca3 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/KaptchaController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/KaptchaController.java @@ -1,5 +1,6 @@ package com.dsh.guns.modular.system.controller.system; +import com.dsh.course.util.RedisUtil; import com.dsh.guns.config.properties.GunsProperties; import com.dsh.guns.core.util.FileUtil; import com.google.code.kaptcha.Constants; @@ -34,6 +35,9 @@ @Autowired private Producer producer; + @Autowired + private RedisUtil redisUtil; + /** * 生成验证码 */ @@ -57,10 +61,11 @@ // create the text for the image String capText = producer.createText(); - + String cookie = request.getHeader("cookie"); + System.err.println("cookie:" + cookie); + redisUtil.setStrValue(cookie, capText, 300); // store the text in the session session.setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); - // create the image with the text BufferedImage bi = producer.createImage(capText); ServletOutputStream out = null; -- Gitblit v1.7.1