|
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
-import com.ruoyi.common.config.Global;
|
|
|
|
|
|
+import com.ruoyi.common.config.RuoYiConfig;
|
|
import com.ruoyi.common.config.ServerConfig;
|
|
import com.ruoyi.common.config.ServerConfig;
|
|
import com.ruoyi.common.constant.Constants;
|
|
import com.ruoyi.common.constant.Constants;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -48,7 +48,7 @@ public class CommonController
|
|
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
|
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
|
}
|
|
}
|
|
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
|
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
|
- String filePath = Global.getDownloadPath() + fileName;
|
|
|
|
|
|
+ String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
|
|
|
|
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
|
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
|
@@ -74,7 +74,7 @@ public class CommonController
|
|
try
|
|
try
|
|
{
|
|
{
|
|
// 上传文件路径
|
|
// 上传文件路径
|
|
- String filePath = Global.getUploadPath();
|
|
|
|
|
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
// 上传并返回新文件名称
|
|
// 上传并返回新文件名称
|
|
String fileName = FileUploadUtils.upload(filePath, file);
|
|
String fileName = FileUploadUtils.upload(filePath, file);
|
|
String url = serverConfig.getUrl() + fileName;
|
|
String url = serverConfig.getUrl() + fileName;
|
|
@@ -103,7 +103,7 @@ public class CommonController
|
|
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
|
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
|
}
|
|
}
|
|
// 本地资源路径
|
|
// 本地资源路径
|
|
- String localPath = Global.getProfile();
|
|
|
|
|
|
+ String localPath = RuoYiConfig.getProfile();
|
|
// 数据库资源地址
|
|
// 数据库资源地址
|
|
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
|
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
|
// 下载名称
|
|
// 下载名称
|