|
@ -12,6 +12,7 @@ import org.springframework.boot.context.embedded.FilterRegistrationBean;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.context.annotation.Profile;
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
@ -20,7 +21,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
|
|
* Created by chenweida on 2017/4/6.
|
|
|
*/
|
|
|
@Configuration
|
|
|
@Profile({"test", "prod"})
|
|
|
//@Profile({"test", "prod"})
|
|
|
public class MvcConfig extends WebMvcConfigurerAdapter {
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(MvcConfig.class);
|
|
@ -82,9 +83,11 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
|
|
|
@Override
|
|
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
|
String tempPath = SystemConf.getInstance().getTempPath() ;
|
|
|
registry.addResourceHandler(tempPath+"/**").addResourceLocations("file:F:"+tempPath);
|
|
|
registry.addResourceHandler(tempPath+"/**").addResourceLocations("file:F:"+tempPath+"/");
|
|
|
|
|
|
super.addResourceHandlers(registry);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|