|
@@ -0,0 +1,28 @@
|
|
|
+package cn.com.qmth.examcloud.service.core;
|
|
|
+
|
|
|
+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.InterceptorRegistry;
|
|
|
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.common.uac.AccessCtrlInterceptor;
|
|
|
+
|
|
|
+/**
|
|
|
+ * prod环境开启权限验证
|
|
|
+ * @author ting.yin
|
|
|
+ */
|
|
|
+@Configuration
|
|
|
+//@Profile("prod")
|
|
|
+public class AccessControlConfig extends WebMvcConfigurerAdapter {
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ public AccessCtrlInterceptor getInterceptor() {
|
|
|
+ return new AccessCtrlInterceptor();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void addInterceptors(InterceptorRegistry registry) {
|
|
|
+ registry.addInterceptor(getInterceptor()).addPathPatterns("/**").excludePathPatterns("/**/swagger-ui.html#/**");
|
|
|
+ }
|
|
|
+}
|