Eric 2 år sedan
förälder
incheckning
0919c2b413

+ 10 - 1
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/StoragePluginContext.java

@@ -45,7 +45,16 @@ public class StoragePluginContext {
 
 	public String getPublicUrl(String fileName,String bucketName){
 		try {
-			String substring = fileName.substring(0, fileName.lastIndexOf("?"));
+
+			// 文件地址
+			String substring = fileName;
+
+			// 访问后缀参数
+			int indexOf = fileName.lastIndexOf("?");
+			if (indexOf > -1) {
+				substring = fileName.substring(0, fileName.lastIndexOf("?"));
+			}
+
 			String substring1 = substring.substring(substring.lastIndexOf("/") + 1);
 			this.setFileAcl(KS3StoragePlugin.PLUGIN_NAME,substring1,true,bucketName);
 			return substring;