From 3cc66f911c6a7b0d55ddb58c67e16963195ea351 Mon Sep 17 00:00:00 2001 From: zhaoxiaohao <279049017@qq.com> Date: Mon, 08 Mar 2021 18:42:39 +0800 Subject: [PATCH] 账号强制被踢出登录状态逻辑的优化 --- kidgrow-uaa/kidgrow-uaa-server/src/main/java/com/kidgrow/oauth2/controller/ValidateCodeController.java | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/kidgrow-uaa/kidgrow-uaa-server/src/main/java/com/kidgrow/oauth2/controller/ValidateCodeController.java b/kidgrow-uaa/kidgrow-uaa-server/src/main/java/com/kidgrow/oauth2/controller/ValidateCodeController.java index 03d9e5d..0c72720 100644 --- a/kidgrow-uaa/kidgrow-uaa-server/src/main/java/com/kidgrow/oauth2/controller/ValidateCodeController.java +++ b/kidgrow-uaa/kidgrow-uaa-server/src/main/java/com/kidgrow/oauth2/controller/ValidateCodeController.java @@ -7,6 +7,7 @@ import com.wf.captcha.base.Captcha; import com.wf.captcha.utils.CaptchaUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.GetMapping; @@ -33,13 +34,15 @@ * * @throws Exception */ - @GetMapping(SecurityConstants.DEFAULT_VALIDATE_CODE_URL_PREFIX + "/{deviceId}") + @GetMapping(value=SecurityConstants.DEFAULT_VALIDATE_CODE_URL_PREFIX + "/{deviceId}",produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) public void createCode(@PathVariable String deviceId, HttpServletResponse response) throws Exception { Assert.notNull(deviceId, "机器码不能为空"); // 设置请求头为输出图片类型 CaptchaUtil.setHeader(response); // 三个参数分别为宽、高、位数 +// GifCaptcha gifCaptcha = new GifCaptcha(100, 35, 4,new Font("actionj", 1, 32)); GifCaptcha gifCaptcha = new GifCaptcha(100, 35, 4); +// gifCaptcha.setFont(Captcha.FONT_1); // 设置类型:字母数字混合 gifCaptcha.setCharType(Captcha.TYPE_DEFAULT); // 保存验证码 -- Gitblit v1.8.0