mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-22 13:26: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);
|
RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
|
||||||
|
|
||||||
// 说明注解去掉了
|
// 说明注解去掉了
|
||||||
if (annotation != null) {
|
if (annotation == null) {
|
||||||
return point.proceed();
|
return point.proceed();
|
||||||
}
|
}
|
||||||
|
|
||||||
int interval = Math.min(annotation.value(), RepeatSubmit.MAX_INTERVAL);
|
int interval = Math.min(annotation.value(), RepeatSubmit.MAX_INTERVAL);
|
||||||
if (System.currentTimeMillis() < timeStamp + interval) {
|
if (System.currentTimeMillis() < timeStamp + interval) {
|
||||||
|
// 续上时间 能在间隔时间内反复提示用户提交频繁
|
||||||
|
this.repeatSubmitTicket.putTicket(ticket);
|
||||||
// 提交频繁
|
// 提交频繁
|
||||||
return ResponseDTO.error(UserErrorCode.REPEAT_SUBMIT);
|
return ResponseDTO.error(UserErrorCode.REPEAT_SUBMIT);
|
||||||
}
|
}
|
||||||
@ -80,8 +82,6 @@ public class RepeatSubmitAspect {
|
|||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
log.error("", throwable);
|
log.error("", throwable);
|
||||||
throw throwable;
|
throw throwable;
|
||||||
} finally {
|
|
||||||
this.repeatSubmitTicket.removeTicket(ticket);
|
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user