SmartAdminWebAppConfig.java 925 B

12345678910111213141516171819202122232425
  1. package net.lab1024.smartadmin.config;
  2. import net.lab1024.smartadmin.interceptor.SmartAuthenticationInterceptor;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.context.annotation.Configuration;
  5. import org.springframework.web.servlet.config.annotation.*;
  6. @Configuration
  7. public class SmartAdminWebAppConfig implements WebMvcConfigurer {
  8. @Autowired
  9. private SmartAuthenticationInterceptor smartAuthenticationInterceptor;
  10. @Override
  11. public void addInterceptors(InterceptorRegistry registry) {
  12. registry.addInterceptor(smartAuthenticationInterceptor).addPathPatterns("/**");
  13. }
  14. @Override
  15. public void addViewControllers(ViewControllerRegistry registry) {
  16. registry.addViewController("/druidMonitor").setViewName("redirect:/druid/index.html");
  17. registry.addViewController("/swaggerApi").setViewName("redirect:/swagger-ui.html");
  18. }
  19. }