package com.gxzc.zen.umps.config import com.baomidou.kisso.web.interceptor.SSOPermissionInterceptor import com.baomidou.kisso.web.interceptor.SSOSpringInterceptor import org.springframework.context.annotation.Configuration import org.springframework.web.bind.annotation.ControllerAdvice import org.springframework.web.servlet.config.annotation.InterceptorRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter /** * kisso配置 * 跳过 swagger-ui 验证 */ @ControllerAdvice @Configuration class KissoWebAppConfigurer : WebMvcConfigurerAdapter() { override fun addInterceptors(registry: InterceptorRegistry) { // 登录拦截 registry.addInterceptor(SSOSpringInterceptor()) .addPathPatterns("/**") .excludePathPatterns( "/auth/login", "/swagger-ui.html", // swagger-ui html "/v2/api-docs", // swagger "/webjars/**", // swagger-ui webjars "/swagger-resources/**", // swagger-ui resources "/configuration/**" // swagger configuration ) // 权限拦截 registry.addInterceptor(SSOPermissionInterceptor().also { it.authorization = KissoAuthorization() }) .addPathPatterns("/**") .excludePathPatterns( "/auth/login", "/swagger-ui.html", // swagger-ui html "/v2/api-docs", // swagger "/webjars/**", // swagger-ui webjars "/swagger-resources/**", // swagger-ui resources "/configuration/**" // swagger configuration ) // super.addInterceptors(registry) } }