Skip to content

Commit 78d0132

Browse files
committed
Fix: Config ์ˆ˜์ •
1 parent c0eea18 commit 78d0132

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

โ€Žsrc/main/java/cmf/commitField/global/security/WebConfig.javaโ€Ž

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.springframework.context.annotation.Configuration;
44
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
5+
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
56
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
67

78
@Configuration
@@ -17,6 +18,13 @@ public WebConfig(LoginCheckInterceptor loginCheckInterceptor) {
1718
public void addInterceptors(InterceptorRegistry registry) {
1819
// @LoginCheck๊ฐ€ ๋ถ™์€ ๋ฉ”์„œ๋“œ์— ๋Œ€ํ•ด ์ธํ„ฐ์…‰ํ„ฐ๋ฅผ ์ ์šฉ
1920
registry.addInterceptor(loginCheckInterceptor)
20-
.addPathPatterns("/chat/**"); // /chat ๊ฒฝ๋กœ์—๋งŒ ์ธํ„ฐ์…‰ํ„ฐ ์ ์šฉ
21+
.addPathPatterns("/chat/**", "/uploads/**"); // /chat ๊ฒฝ๋กœ์—๋งŒ ์ธํ„ฐ์…‰ํ„ฐ ์ ์šฉ
22+
}
23+
24+
@Override
25+
public void addResourceHandlers(ResourceHandlerRegistry registry) {
26+
// /uploads/** ๊ฒฝ๋กœ๊ฐ€ ์‹ค์ œ ํŒŒ์ผ ์‹œ์Šคํ…œ์—์„œ ์ œ๊ณต๋˜๋„๋ก ์„ค์ •
27+
registry.addResourceHandler("/uploads/**")
28+
.addResourceLocations("file:src/main/resources/static/uploads/");
2129
}
2230
}

0 commit comments

Comments
ย (0)