|
@@ -0,0 +1,45 @@
|
|
|
+package cn.com.qmth.examcloud.core.oe.student.starter.config;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import org.springframework.web.servlet.HandlerInterceptor;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
|
|
|
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
|
+import cn.com.qmth.examcloud.web.enums.HttpServletRequestAttribute;
|
|
|
+import cn.com.qmth.examcloud.web.support.ApiInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 考试拦截器
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @date 2019年7月24日
|
|
|
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
|
|
|
+ */
|
|
|
+public class ExamingInterceptor implements HandlerInterceptor {
|
|
|
+
|
|
|
+ private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(ExamingInterceptor.class);
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
|
|
|
+ Object handler) throws Exception {
|
|
|
+
|
|
|
+ LOG.debug("[preHandle].");
|
|
|
+
|
|
|
+ ApiInfo apiInfo = (ApiInfo) request
|
|
|
+ .getAttribute(HttpServletRequestAttribute.$_API_INFO.name());
|
|
|
+
|
|
|
+ if (null == apiInfo) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterCompletion(HttpServletRequest request, HttpServletResponse response,
|
|
|
+ Object handler, Exception ex) throws Exception {
|
|
|
+ LOG.debug("[afterCompletion].");
|
|
|
+ }
|
|
|
+}
|