|
|
|
|
@ -5,10 +5,10 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import org.springframework.web.method.HandlerMethod;
|
|
|
|
|
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
|
|
|
|
import org.springframework.web.servlet.HandlerInterceptor;
|
|
|
|
|
import com.ruoyi.common.json.JSON;
|
|
|
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.json.JSON;
|
|
|
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -17,7 +17,7 @@ import com.ruoyi.common.utils.ServletUtils;
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
*/
|
|
|
|
|
@Component
|
|
|
|
|
public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
|
|
|
|
|
public abstract class RepeatSubmitInterceptor implements HandlerInterceptor
|
|
|
|
|
{
|
|
|
|
|
@Override
|
|
|
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
|
|
|
|
|
@ -40,16 +40,16 @@ public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return super.preHandle(request, response, handler);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 验证是否重复提交由子类实现具体的防重复提交的规则
|
|
|
|
|
*
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
* @param request 请求对象
|
|
|
|
|
* @param annotation 防复注解
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation) throws Exception;
|
|
|
|
|
}
|
|
|
|
|
|