Commit 9d5d192175ed4b8f9bb16ce214ae0964a8e0e8ec
Committed by
Gitee
1 parent
8505873e
fix:使用一键改包之后,可能导致的自定义lock4j失败策略bean与lock4j提供的默认失败策略bean冲突问题
解决方法: 使用@AutoConfigureBefore注解,指定自定义bean在LockAutoConfiguration之前进行加载,使得LockAutoConfiguration中的失败策略bean上的@ConditionalOnMissingBean注解生效
Showing
1 changed file
with
3 additions
and
0 deletions
yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java
| 1 | 1 | package cn.iocoder.yudao.framework.lock4j.config; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.util.ClassUtil; |
| 4 | +import com.baomidou.lock.spring.boot.autoconfigure.LockAutoConfiguration; | |
| 4 | 5 | import cn.iocoder.yudao.framework.lock4j.core.DefaultLockFailureStrategy; |
| 5 | 6 | import cn.iocoder.yudao.framework.lock4j.core.Lock4jRedisKeyConstants; |
| 7 | +import org.springframework.boot.autoconfigure.AutoConfigureBefore; | |
| 6 | 8 | import org.springframework.context.annotation.Bean; |
| 7 | 9 | import org.springframework.context.annotation.Configuration; |
| 8 | 10 | |
| 9 | 11 | @Configuration |
| 12 | +@AutoConfigureBefore(LockAutoConfiguration.class) | |
| 10 | 13 | public class YudaoLock4jConfiguration { |
| 11 | 14 | |
| 12 | 15 | static { | ... | ... |