|
|
|
@ -77,14 +77,18 @@ public class RepeatSubmitAspect {
|
|
|
|
|
@AfterReturning(pointcut = "@annotation(repeatSubmit)", returning = "jsonResult")
|
|
|
|
|
public void doAfterReturning(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Object jsonResult) {
|
|
|
|
|
if (jsonResult instanceof R) {
|
|
|
|
|
try {
|
|
|
|
|
R<?> r = (R<?>) jsonResult;
|
|
|
|
|
// 成功则不删除redis数据 保证在有效时间内无法重复提交
|
|
|
|
|
if (r.getCode() == R.SUCCESS) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
RedisUtils.deleteObject(KEY_CACHE.get());
|
|
|
|
|
} finally {
|
|
|
|
|
KEY_CACHE.remove();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 拦截异常操作
|
|
|
|
|