KissoWebAppConfigurer.kt 1018 B

123456789101112131415161718192021222324252627
  1. package com.gxzc.zen.ump
  2. import com.baomidou.kisso.web.interceptor.SSOPermissionInterceptor
  3. import com.baomidou.kisso.web.interceptor.SSOSpringInterceptor
  4. import org.springframework.context.annotation.Bean
  5. import org.springframework.context.annotation.Configuration
  6. import org.springframework.web.servlet.config.annotation.InterceptorRegistry
  7. import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
  8. @Configuration
  9. class KissoWebAppConfigurer : WebMvcConfigurerAdapter() {
  10. /*@Bean("KissoInit")
  11. fun initKisso(){
  12. return com.baomidou.kisso.web.WebKissoConfigurer()
  13. }*/
  14. override fun addInterceptors(registry: InterceptorRegistry) {
  15. //登录拦截
  16. registry.addInterceptor(SSOSpringInterceptor())
  17. .addPathPatterns("/**")
  18. //权限拦截
  19. registry.addInterceptor(SSOPermissionInterceptor().also { it.authorization = KissoAuthorization() })
  20. .addPathPatterns("/**")
  21. super.addInterceptors(registry)
  22. }
  23. }