首页>代码>spring boot整合freemaker开发医院管理系统>/hospital/src/main/java/com/gbq/hospital/config/listener/SpringEventListener.java
package com.gbq.hospital.config.listener;

import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.springframework.context.ApplicationContext;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/** 
 * 创建时间:2017年12月19日 下午3:21:26
 * @author  gbq
 * @version  
 * 
 */
@Component
public class SpringEventListener {
    @EventListener
    public void handleContextRefresh(ContextRefreshedEvent event) {
        ApplicationContext context = event.getApplicationContext();
        DefaultWebSecurityManager manager = (DefaultWebSecurityManager) context.getBean("securityManager");
        AuthorizingRealm realm = (AuthorizingRealm) context.getBean("userRealm");
        manager.setRealm(realm);
    }
}
最近下载更多
zjjhzjb  LV15 4月16日
微信网友_7134912998903808  LV15 2024年9月11日
jiyun2021  LV9 2024年7月15日
FF加菲猫  LV4 2024年2月15日
woshiwo  LV3 2024年1月17日
xuyang1991  LV2 2023年12月26日
adaddad  LV2 2023年11月11日
skook7  LV2 2023年8月31日
LYLHYC  LV5 2023年8月2日
五折也挺好的  LV13 2023年7月10日
最近浏览更多
denliv_hui  LV14 8月7日
zjb243665659  LV7 4月16日
zjjhzjb  LV15 4月16日
TaoTaot 4月7日
暂无贡献等级
blanknb 3月18日
暂无贡献等级
abdkfksdkf  LV16 2月23日
zhihou  LV2 2月6日
2602275348  LV12 1月6日
暂无贡献等级
WHY-small  LV15 2024年12月28日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友