From 26f0737c6099f13ab4eedd36a37463c83a666cc6 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Mon, 20 Sep 2021 19:09:25 +0800
Subject: [PATCH] 防重提交注解支持配置间隔时间/提示消息
---
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
index bce2f3f..7b7f5a4 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
@@ -13,7 +13,7 @@
/**
* 防止重复提交拦截器
- *
+ *
* @author ruoyi
*/
@Component
@@ -29,9 +29,9 @@
RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
if (annotation != null)
{
- if (this.isRepeatSubmit(request))
+ if (this.isRepeatSubmit(request, annotation))
{
- AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试");
+ AjaxResult ajaxResult = AjaxResult.error(annotation.message());
ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult));
return false;
}
@@ -46,10 +46,10 @@
/**
* 验证是否重复提交由子类实现具体的防重复提交的规则
- *
- * @param httpServletRequest
+ *
+ * @param request
* @return
* @throws Exception
*/
- public abstract boolean isRepeatSubmit(HttpServletRequest request);
+ public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation);
}
--
Gitblit v1.9.2