WebConfigurer.java 1.0 KB

1234567891011121314151617181920212223242526
  1. package com.nosum.common.config;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
  5. import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  6. @Configuration
  7. public class WebConfigurer implements WebMvcConfigurer {
  8. // @Autowired
  9. // private ConfigDao configDao;
  10. @Override
  11. public void addResourceHandlers(final ResourceHandlerRegistry registry) {
  12. // String defaultPath;
  13. // try {
  14. // Config config = configDao.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getConfigKey, Constants.DEFAULT_PATH));
  15. // defaultPath = config.getConfigValue();
  16. // } catch (Exception e) {
  17. // defaultPath = ConstantsModels.getDefaultPath(ConfigCache.getConfig(Constants.DEFAULT_PATH));
  18. // }
  19. // registry.addResourceHandler("/files/**").addResourceLocations("file:///" + defaultPath);
  20. }
  21. }