|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ArrayUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
import com.vber.common.core.constant.GlobalConstants;
|
|
|
+import com.vber.common.core.constant.HttpStatus;
|
|
|
import com.vber.common.core.domain.R;
|
|
|
import com.vber.common.core.exception.ServiceException;
|
|
|
import com.vber.common.core.utils.MessageUtils;
|
|
|
@@ -76,16 +77,16 @@ public class RepeatSubmitAspect {
|
|
|
*/
|
|
|
@AfterReturning(pointcut = "@annotation(repeatSubmit)", returning = "jsonResult")
|
|
|
public void doAfterReturning(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Object jsonResult) {
|
|
|
- if (jsonResult instanceof R<?> r) {
|
|
|
- try {
|
|
|
+ try {
|
|
|
+ if (jsonResult instanceof R<?> r) {
|
|
|
// 成功则不删除redis数据 保证在有效时间内无法重复提交
|
|
|
- if (r.getCode() == R.SUCCESS) {
|
|
|
+ if (r.getCode() == HttpStatus.SUCCESS) {
|
|
|
return;
|
|
|
}
|
|
|
RedisUtils.deleteObject(KEY_CACHE.get());
|
|
|
- } finally {
|
|
|
- KEY_CACHE.remove();
|
|
|
}
|
|
|
+ } finally {
|
|
|
+ KEY_CACHE.remove();
|
|
|
}
|
|
|
}
|
|
|
|