|
@@ -67,6 +67,8 @@ import java.nio.charset.StandardCharsets;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
+import java.util.regex.Pattern;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
@@ -1494,12 +1496,20 @@ public class AuthServiceImpl implements AuthService {
|
|
String fileName = "";
|
|
String fileName = "";
|
|
String ossurl = challengeRoundVo.getOssUrl();
|
|
String ossurl = challengeRoundVo.getOssUrl();
|
|
ossurl.indexOf(".");
|
|
ossurl.indexOf(".");
|
|
|
|
+ String title=challengeRoundVo.getTitle();
|
|
|
|
+ Pattern pattern = Pattern.compile("[\\s\\\\/:\\*\\?\\\"<>\\|]");
|
|
|
|
+ Matcher matcher = pattern.matcher(title);
|
|
|
|
+ title= matcher.replaceAll("");
|
|
|
|
+ if(title.length()>50){
|
|
|
|
+ title= title.substring(0,50);
|
|
|
|
+ }
|
|
if ("dev".equals(active)) {
|
|
if ("dev".equals(active)) {
|
|
- fileName = zipPath + "\\"+challengeRoundVo.getTitle() + ossurl.substring(ossurl.lastIndexOf("."));
|
|
|
|
|
|
+ fileName = zipPath + "\\"+title + ossurl.substring(ossurl.lastIndexOf("."));
|
|
} else {
|
|
} else {
|
|
- fileName = zipPath + "/"+challengeRoundVo.getTitle() + ossurl.substring(ossurl.lastIndexOf("."));
|
|
|
|
|
|
+ fileName = zipPath + "/"+title + ossurl.substring(ossurl.lastIndexOf("."));
|
|
}
|
|
}
|
|
- OSSUtils.downFileByFilePath("authFile/", challengeRoundVo.getOssName(), fileName);
|
|
|
|
|
|
+
|
|
|
|
+ OSSUtils.downFileByFilePath("authFile/", challengeRoundVo.getOssName(), fileName);
|
|
// else {
|
|
// else {
|
|
// //文件夹在uuid文件夹下创建自己包名的文件夹
|
|
// //文件夹在uuid文件夹下创建自己包名的文件夹
|
|
// String param = fileTreeVo.getId() + "," + authUserId;
|
|
// String param = fileTreeVo.getId() + "," + authUserId;
|
|
@@ -1560,10 +1570,17 @@ public class AuthServiceImpl implements AuthService {
|
|
//普通文件直接下载到临时文件夹uuid下
|
|
//普通文件直接下载到临时文件夹uuid下
|
|
String fileName = "";
|
|
String fileName = "";
|
|
String ossurl = challengeRoundVo.getOssUrl();
|
|
String ossurl = challengeRoundVo.getOssUrl();
|
|
|
|
+ String title=challengeRoundVo.getTitle();
|
|
|
|
+ Pattern pattern = Pattern.compile("[\\s\\\\/:\\*\\?\\\"<>\\|]");
|
|
|
|
+ Matcher matcher = pattern.matcher(title);
|
|
|
|
+ title= matcher.replaceAll("");
|
|
|
|
+ if(title.length()>50){
|
|
|
|
+ title= title.substring(0,50);
|
|
|
|
+ }
|
|
if ("dev".equals(active)) {
|
|
if ("dev".equals(active)) {
|
|
- fileName = zipPath + "\\"+challengeRoundVo.getTitle() +ossurl.substring(ossurl.lastIndexOf("."));
|
|
|
|
|
|
+ fileName = zipPath + "\\"+title +ossurl.substring(ossurl.lastIndexOf("."));
|
|
} else {
|
|
} else {
|
|
- fileName = zipPath + "/"+challengeRoundVo.getTitle() + ossurl.substring(ossurl.lastIndexOf("."));
|
|
|
|
|
|
+ fileName = zipPath + "/"+title + ossurl.substring(ossurl.lastIndexOf("."));
|
|
}
|
|
}
|
|
OSSUtils.downFileByFilePath("authFile/", challengeRoundVo.getOssName(), fileName);
|
|
OSSUtils.downFileByFilePath("authFile/", challengeRoundVo.getOssName(), fileName);
|
|
// else {
|
|
// else {
|