Переглянути джерело

修改路径的获取方式

zhangqiankun 3 роки тому
батько
коміт
bd586ab19b

+ 5 - 2
src/main/java/com/persagy/cameractl/utils/OtherTools.java

@@ -16,6 +16,9 @@ public class OtherTools {
 	public static String playMp4RootUrl = "/vplayf/";
 	public static String dahuaDllPath = "";
 	public static String fileSperator = File.separator;
+	
+	/** 项目根路径*/
+	public static final String SERVER_ROOT_PATH = System.getProperty("user.dir");
 
 	/*
 	 * 获取系统的操作系统类型
@@ -40,7 +43,7 @@ public class OtherTools {
 			newPath = dllName;
 			break;
 		default:
-			String dllPath = "./resourcesFile/cameraDll/" + systemName.toString() + "/" + dllName;
+			String dllPath = SERVER_ROOT_PATH + "/resourcesFile/cameraDll/" + systemName.toString() + "/" + dllName;
 			try {
 				File file1 = new File(dllPath);
 				newPath = file1.getCanonicalPath();
@@ -73,7 +76,7 @@ public class OtherTools {
 	};
 
 	public static String getVideoFileDir() {
-		String dllPath = "./resourcesFile/tempVideo";
+		String dllPath = SERVER_ROOT_PATH + "/resourcesFile/tempVideo";
 		String newPath = "";
 		try {
 			File file1 = new File(dllPath);