whycxzp
2021-01-14 9a053c132a1c9b7675a1694dc4fc10a69eeda3fd
src/main/java/com/whyc/realm/CustomRealm.java
@@ -11,6 +11,7 @@
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.util.ByteSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import javax.annotation.PostConstruct;
@@ -20,6 +21,8 @@
@Realm
public class CustomRealm extends AuthorizingRealm {
    /**必须@Lazy注解,@Lazy与@Autowired组合,使得依赖于Service相关的Bean都是lazy-resolution proxy*/
    @Lazy
    @Autowired
    UserBridgeService userBridgeService;