| | |
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.web.method.HandlerMethod;
|
| | | import org.springframework.web.servlet.HandlerInterceptor;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.alibaba.fastjson2.JSON;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.framework.interceptor.annotation.RepeatSubmit;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | |
| | | if (this.isRepeatSubmit(request, annotation))
|
| | | {
|
| | | AjaxResult ajaxResult = AjaxResult.error(annotation.message());
|
| | | ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult));
|
| | | ServletUtils.renderString(response, JSON.toJSONString(ajaxResult));
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | | /**
|
| | | * 验证是否重复提交由子类实现具体的防重复提交的规则
|
| | | *
|
| | | * @param request
|
| | | * @return
|
| | | * @param request 请求信息
|
| | | * @param annotation 防重复注解参数
|
| | | * @return 结果
|
| | | * @throws Exception
|
| | | */
|
| | | public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation);
|