Commit 18027452 authored by jiaorz's avatar jiaorz

验证码图片问题

parent 73f66c49
...@@ -11,7 +11,7 @@ public class ImageUtils { ...@@ -11,7 +11,7 @@ public class ImageUtils {
public static String getClickWordBgPath (){ public static String getClickWordBgPath (){
String path1 = Thread.currentThread().getContextClassLoader().getResource("").getPath();//获取当前资源的虚拟路径 String path1 = Thread.currentThread().getContextClassLoader().getResource("").getPath();//获取当前资源的虚拟路径
String imagePath = path1.substring(0, path1.indexOf("target")) + "src/resources/images/pic-click"; String imagePath = path1.substring(0, path1.indexOf("target")) + "src/main/resources/images/pic-click";
File file = new File(imagePath); File file = new File(imagePath);
String[] files = file.list(); String[] files = file.list();
int randomNum = RandomUtils.getRandomInt(1 , files.length); int randomNum = RandomUtils.getRandomInt(1 , files.length);
...@@ -22,7 +22,7 @@ public class ImageUtils { ...@@ -22,7 +22,7 @@ public class ImageUtils {
public static String getBlockPuzzleBgPath (){ public static String getBlockPuzzleBgPath (){
String path1 = Thread.currentThread().getContextClassLoader().getResource("").getPath();//获取当前资源的虚拟路径 String path1 = Thread.currentThread().getContextClassLoader().getResource("").getPath();//获取当前资源的虚拟路径
String imagePath = path1.substring(0, path1.indexOf("target")) + "src/resources/images/jigsaw/original"; String imagePath = path1.substring(0, path1.indexOf("target")) + "src/main/resources/images/jigsaw/original";
File file = new File(imagePath); File file = new File(imagePath);
String[] files = file.list(); String[] files = file.list();
int randomNum = RandomUtils.getRandomInt(1 , files.length); int randomNum = RandomUtils.getRandomInt(1 , files.length);
...@@ -35,7 +35,7 @@ public class ImageUtils { ...@@ -35,7 +35,7 @@ public class ImageUtils {
public static String getBlockPuzzleJigsawPath (){ public static String getBlockPuzzleJigsawPath (){
String path1 = Thread.currentThread().getContextClassLoader().getResource("").getPath();//获取当前资源的虚拟路径 String path1 = Thread.currentThread().getContextClassLoader().getResource("").getPath();//获取当前资源的虚拟路径
String imagePath = path1.substring(0, path1.indexOf("target")) + "src/resources/images/jigsaw/slidingBlock"; String imagePath = path1.substring(0, path1.indexOf("target")) + "src/main/resources/images/jigsaw/slidingBlock";
File file = new File(imagePath); File file = new File(imagePath);
String[] files = file.list(); String[] files = file.list();
int randomNum = RandomUtils.getRandomInt(1 , files.length); int randomNum = RandomUtils.getRandomInt(1 , files.length);
......
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