File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/cmf/commitField/global/security Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 22
33import org .springframework .context .annotation .Configuration ;
44import org .springframework .web .servlet .config .annotation .InterceptorRegistry ;
5+ import org .springframework .web .servlet .config .annotation .ResourceHandlerRegistry ;
56import 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}
You canโt perform that action at this time.
0 commit comments