Commit d8599f66 authored by jiaorz's avatar jiaorz

验证码图片问题

parent 4c858772
...@@ -115,11 +115,15 @@ public class ClickWordCaptcha extends AbstractCaptcha { ...@@ -115,11 +115,15 @@ public class ClickWordCaptcha extends AbstractCaptcha {
BufferedImage combinedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); BufferedImage combinedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics combinedGraphics = combinedImage.getGraphics(); Graphics combinedGraphics = combinedImage.getGraphics();
combinedGraphics.drawImage(backgroundImage, 0, 0, null); combinedGraphics.drawImage(backgroundImage, 0, 0, null);
Point point = pointList.get(RandomUtils.getRandomInt(0, wordList.size()-1).intValue()); int index =RandomUtils.getRandomInt(0, wordList.size()-1).intValue();
Point point = pointList.get(index);
dataVO.setOriginalImageBase64(getImageToBase64Str(backgroundImage)); dataVO.setOriginalImageBase64(getImageToBase64Str(backgroundImage));
List<Point> list = Lists.newArrayList(); List<Point> list = Lists.newArrayList();
list.add(point); list.add(point);
dataVO.setPointList(list); dataVO.setPointList(list);
String word = wordList.get(index);
List<String> wordString = Lists.newArrayList();
wordString.add(word);
dataVO.setWordList(wordList); dataVO.setWordList(wordList);
return dataVO; return dataVO;
} }
......
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