Commit d96478ea authored by jiaorz's avatar jiaorz

Merge branch 'master-captcha-branch' into dev

parents b298d58b d8599f66
......@@ -107,6 +107,7 @@ public class ClickWordCaptcha extends AbstractCaptcha {
if ((num-1) != i) {
wordList.add(word);
pointList.add(point);
}
}
......@@ -114,11 +115,15 @@ public class ClickWordCaptcha extends AbstractCaptcha {
BufferedImage combinedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics combinedGraphics = combinedImage.getGraphics();
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));
List<Point> list = Lists.newArrayList();
list.add(point);
dataVO.setPointList(list);
String word = wordList.get(index);
List<String> wordString = Lists.newArrayList();
wordString.add(word);
dataVO.setWordList(wordList);
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