From 8958b3ef5f812419292de2f522df1f303734450c Mon Sep 17 00:00:00 2001 From: ssl <1151868461@qq.com> Date: Thu, 11 May 2023 10:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=A8=E5=9F=9F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=9B=BE=E7=89=87=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=98=A0=E5=B0=84=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/votesystem/ssl/config/MyWebConfiguration.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vote/src/main/java/com/votesystem/ssl/config/MyWebConfiguration.java b/vote/src/main/java/com/votesystem/ssl/config/MyWebConfiguration.java index fb2552a..91e07c5 100644 --- a/vote/src/main/java/com/votesystem/ssl/config/MyWebConfiguration.java +++ b/vote/src/main/java/com/votesystem/ssl/config/MyWebConfiguration.java @@ -18,14 +18,18 @@ public class MyWebConfiguration implements WebMvcConfigurer { .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") .allowedHeaders("*") .maxAge(3600); - } @Override + } + + + @Value("${image.save-path}") + private String imagePath; + + @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/api/file/**").addResourceLocations("file:" + imagePath + "/"); // registry.addResourceHandler(imagePath).addResourceLocations("file:" + imagePath + "/"); } - @Value("${image.save-path}") - private String imagePath;