From b1a6188c6b3d3454d32440c555e41402739afbc9 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 24 十月 2025 18:16:26 +0800
Subject: [PATCH] bug修改,后台新增修改用户积分
---
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/KaptchaController.java | 10 ++++++++--
1 files changed, 8 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 469f65f..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;
@@ -23,6 +24,7 @@
* @author fengshuonan
* @date 2017-05-05 23:10
*/
+
@Controller
@RequestMapping("/kaptcha")
public class KaptchaController {
@@ -32,6 +34,9 @@
@Autowired
private Producer producer;
+
+ @Autowired
+ private RedisUtil redisUtil;
/**
* 生成验证码
@@ -56,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