From 4acdf5ffaa825692e844fafd52378c2471140550 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Mon, 26 Aug 2019 15:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=9D=99=E6=80=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cm/common/plugin/service/file/impl/FileServiceImpl.java | 2 +- cloud-common/src/main/java/com/cm/common/config/WebConfig.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java index 97934db..24f774f 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java @@ -141,7 +141,6 @@ public class FileServiceImpl extends AbstractService implements IFileService { outputStream.flush(); } catch (Exception e) { LOG.error(e.getMessage(), e); - throw new SearchException("文件获取失败"); } finally { try { if (null != outputStream) { @@ -153,6 +152,7 @@ public class FileServiceImpl extends AbstractService implements IFileService { } catch (Exception e1) { LOG.error(e1.getMessage(), e1); } + throw new SearchException("文件获取失败"); } } diff --git a/cloud-common/src/main/java/com/cm/common/config/WebConfig.java b/cloud-common/src/main/java/com/cm/common/config/WebConfig.java index 98a6c0a..8136097 100644 --- a/cloud-common/src/main/java/com/cm/common/config/WebConfig.java +++ b/cloud-common/src/main/java/com/cm/common/config/WebConfig.java @@ -28,5 +28,6 @@ public class WebConfig implements WebMvcConfigurer { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/files/**").addResourceLocations("file:" + fileProperties.getUploadPath()); + registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/static/assets/").setCachePeriod(7 * 24 * 3600); } }