Commit 2e85e9f3 authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.天气数据接收定时任务,解决代码扫描问题,修改文件读取相关代码,解决资源未关流问题;
2.修改登录验证码生成工具类,解决代码扫描问题,修复随机数不安全问题;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 2bc14fe1
package pps.core.common.utils; package pps.core.common.utils;
import cn.hutool.core.util.RandomUtil;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.security.SecureRandom;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Random;
/** /**
* 验证码 * 验证码
...@@ -36,7 +38,7 @@ public class VerificationCode { ...@@ -36,7 +38,7 @@ public class VerificationCode {
BufferedImage buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); BufferedImage buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics gd = buffImg.getGraphics(); Graphics gd = buffImg.getGraphics();
// 创建一个随机数生成器类 // 创建一个随机数生成器类
Random random = new Random(); SecureRandom random = RandomUtil.getSecureRandom();
// 将图像填充为白色 // 将图像填充为白色
gd.setColor(Color.WHITE); gd.setColor(Color.WHITE);
gd.fillRect(0, 0, width, height); gd.fillRect(0, 0, width, height);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment