mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 07:16:39 +00:00
20 lines
659 B
Java
20 lines
659 B
Java
package com.java2nb.common.config;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
|
|
@Component
|
|
class WebConfigurer extends WebMvcConfigurerAdapter {
|
|
|
|
@Autowired
|
|
JnConfig jnConfig;
|
|
|
|
@Override
|
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
registry.addResourceHandler(Constant.UPLOAD_FILES_PREFIX + "**")
|
|
.addResourceLocations("file:///" + jnConfig.getUploadPath());
|
|
}
|
|
|
|
} |