| | |
| | | package com.ruoyi.framework.interceptor;
|
| | |
|
| | | import java.lang.reflect.Method;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.JsonUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.web.method.HandlerMethod;
|
| | | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.ruoyi.common.annotation.RepeatSubmit;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | |
|
| | | /**
|
| | | * 防止重复提交拦截器
|
| | |
| | | if (this.isRepeatSubmit(request))
|
| | | {
|
| | | AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试");
|
| | | ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult));
|
| | | ServletUtils.renderString(response, JsonUtils.toJsonString(ajaxResult)); |
| | | return false;
|
| | | }
|
| | | }
|