|
|
@ -49,6 +49,12 @@ public class DownloadUtils {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ReturnResponse<String> response = new ReturnResponse<>(0, "下载成功!!!", "");
|
|
|
|
ReturnResponse<String> response = new ReturnResponse<>(0, "下载成功!!!", "");
|
|
|
|
String realPath = getRelFilePath(fileName, fileAttribute);
|
|
|
|
String realPath = getRelFilePath(fileName, fileAttribute);
|
|
|
|
|
|
|
|
if(!StringUtils.hasText(realPath)){
|
|
|
|
|
|
|
|
response.setCode(1);
|
|
|
|
|
|
|
|
response.setContent(null);
|
|
|
|
|
|
|
|
response.setMsg("下载失败:文件名不合法!" + urlStr);
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!KkFileUtils.isAllowedUpload(realPath)) {
|
|
|
|
if (!KkFileUtils.isAllowedUpload(realPath)) {
|
|
|
|
response.setCode(1);
|
|
|
|
response.setCode(1);
|
|
|
|
response.setContent(null);
|
|
|
|
response.setContent(null);
|
|
|
@ -61,12 +67,6 @@ public class DownloadUtils {
|
|
|
|
response.setMsg(fileName);
|
|
|
|
response.setMsg(fileName);
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!StringUtils.hasText(realPath)){
|
|
|
|
|
|
|
|
response.setCode(1);
|
|
|
|
|
|
|
|
response.setContent(null);
|
|
|
|
|
|
|
|
response.setMsg("下载失败:文件名不合法!" + urlStr);
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(realPath.equals("cunzhai")){
|
|
|
|
if(realPath.equals("cunzhai")){
|
|
|
|
response.setContent(fileDir + fileName);
|
|
|
|
response.setContent(fileDir + fileName);
|
|
|
|
response.setMsg(fileName);
|
|
|
|
response.setMsg(fileName);
|
|
|
|