防重复提交
This commit is contained in:
parent
23f2d59f1a
commit
3e4411e133
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.system.aspect;
|
|||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.bonus.sgzb.common.core.enums.HttpCodeEnum;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.system.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.sgzb.system.util.RedisCache;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
|
|
@ -61,7 +62,7 @@ public class PreventRepeatSubmitAspect {
|
|||
Boolean aBoolean = redisCache.setNxCacheObject(cacheRepeatKey, 1, preventRepeatSubmit.interval(), TimeUnit.SECONDS);
|
||||
//aBoolean为true则证明没有重复提交
|
||||
if(!aBoolean){
|
||||
throw new BusinessException(HttpCodeEnum.REPEATE_ERROR);
|
||||
throw new ServiceException(HttpCodeEnum.REPEATE_ERROR);
|
||||
}
|
||||
return pjp.proceed();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue