mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	fix 修复 幂等组件 逻辑问题导致线程变量未清除
This commit is contained in:
		@@ -85,12 +85,16 @@ public class RepeatSubmitAspect {
 | 
			
		||||
    @AfterReturning(pointcut = "@annotation(repeatSubmit)", returning = "jsonResult")
 | 
			
		||||
    public void doAfterReturning(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Object jsonResult) {
 | 
			
		||||
        if (jsonResult instanceof R) {
 | 
			
		||||
            R<?> r = (R<?>) jsonResult;
 | 
			
		||||
            if (r.getCode() == R.SUCCESS) {
 | 
			
		||||
                return;
 | 
			
		||||
            try {
 | 
			
		||||
                R<?> r = (R<?>) jsonResult;
 | 
			
		||||
                // 成功则不删除redis数据 保证在有效时间内无法重复提交
 | 
			
		||||
                if (r.getCode() == R.SUCCESS) {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                RedisUtils.deleteObject(KEY_CACHE.get());
 | 
			
		||||
            } finally {
 | 
			
		||||
                KEY_CACHE.remove();
 | 
			
		||||
            }
 | 
			
		||||
            RedisUtils.deleteObject(KEY_CACHE.get());
 | 
			
		||||
            KEY_CACHE.remove();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user