mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-22 21:36:39 +08:00
修复 防止重复提交注解 不生效的问题
This commit is contained in:
parent
28834e2515
commit
18c1ac5a5b
@ -61,12 +61,14 @@ public class RepeatSubmitAspect {
|
||||
RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
|
||||
|
||||
// 说明注解去掉了
|
||||
if (annotation != null) {
|
||||
if (annotation == null) {
|
||||
return point.proceed();
|
||||
}
|
||||
|
||||
int interval = Math.min(annotation.value(), RepeatSubmit.MAX_INTERVAL);
|
||||
if (System.currentTimeMillis() < timeStamp + interval) {
|
||||
// 续上时间 能在间隔时间内反复提示用户提交频繁
|
||||
this.repeatSubmitTicket.putTicket(ticket);
|
||||
// 提交频繁
|
||||
return ResponseDTO.error(UserErrorCode.REPEAT_SUBMIT);
|
||||
}
|
||||
@ -80,8 +82,6 @@ public class RepeatSubmitAspect {
|
||||
} catch (Throwable throwable) {
|
||||
log.error("", throwable);
|
||||
throw throwable;
|
||||
} finally {
|
||||
this.repeatSubmitTicket.removeTicket(ticket);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user