|
@@ -0,0 +1,27 @@
|
|
|
|
+package com.qmth.cqb;
|
|
|
|
+
|
|
|
|
+import cn.com.qmth.examcloud.common.uac.AccessCtrlInterceptor;
|
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
|
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
|
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * prod环境开启权限验证
|
|
|
|
+ * Created by yuanpan on 2017/4/13.
|
|
|
|
+ */
|
|
|
|
+@Configuration
|
|
|
|
+//@Profile("prod")
|
|
|
|
+public class AccessControlConfig extends WebMvcConfigurerAdapter {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public AccessCtrlInterceptor getInterceptor() {
|
|
|
|
+ return new AccessCtrlInterceptor();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void addInterceptors(InterceptorRegistry registry) {
|
|
|
|
+ registry.addInterceptor(getInterceptor())
|
|
|
|
+ .addPathPatterns("/**")
|
|
|
|
+ .excludePathPatterns("/**/swagger-ui.html#/**");
|
|
|
|
+ }
|
|
|
|
+}
|