|
@@ -187,7 +187,7 @@ public class CommonController extends BaseController {
|
|
|
throws Exception {
|
|
throws Exception {
|
|
|
try {
|
|
try {
|
|
|
if (!FileUtils.checkAllowDownload(resource)) {
|
|
if (!FileUtils.checkAllowDownload(resource)) {
|
|
|
- throw new Exception(StrUtil.format("资源文件({})非法,不允许下载。 ", resource));
|
|
|
|
|
|
|
+ throw new Exception(StrUtil.format("资源文件({})非法,不允许下载。 ", resource));
|
|
|
}
|
|
}
|
|
|
// 本地资源路径
|
|
// 本地资源路径
|
|
|
String localPath = RuoYiConfig.getProfile();
|
|
String localPath = RuoYiConfig.getProfile();
|
|
@@ -198,7 +198,7 @@ public class CommonController extends BaseController {
|
|
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
|
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
|
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
|
|
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
|
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("下载文件失败", e);
|
|
log.error("下载文件失败", e);
|
|
|
}
|
|
}
|